From 0dc1aef29258197d3a5afd0eae73b094d15ff15f Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20Molakvo=C3=A6?= Date: Thu, 29 Dec 2022 10:06:10 +0100 Subject: [PATCH] chore(actions): update php min supported to 8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .github/workflows/command-compile.yml | 2 +- .github/workflows/ftp.yml | 4 +- .github/workflows/lint-eslint.yml | 2 +- .github/workflows/lint-php-cs.yml | 37 +++++++ .github/workflows/lint-php.yml | 57 ++++++++++ .github/workflows/lint.yml | 42 -------- .github/workflows/node-tests.yml | 8 +- .github/workflows/oci.yml | 2 +- .github/workflows/psalm-github.yml | 2 +- .github/workflows/psalm-security.yml | 2 +- .github/workflows/s3-external.yml | 8 +- .github/workflows/s3-primary.yml | 2 +- .github/workflows/smb-kerberos.yml | 4 +- .github/workflows/static-code-analysis.yml | 109 ++++++++++---------- .github/workflows/update-psalm-baseline.yml | 4 +- 15 files changed, 171 insertions(+), 114 deletions(-) create mode 100644 .github/workflows/lint-php-cs.yml create mode 100644 .github/workflows/lint-php.yml delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/command-compile.yml b/.github/workflows/command-compile.yml index 090324e987b..db8f976eb52 100644 --- a/.github/workflows/command-compile.yml +++ b/.github/workflows/command-compile.yml @@ -54,7 +54,7 @@ jobs: steps: - name: Checkout ${{ needs.init.outputs.head_ref }} - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: token: ${{ secrets.COMMAND_BOT_PAT }} fetch-depth: 0 diff --git a/.github/workflows/ftp.yml b/.github/workflows/ftp.yml index aa9fe3aad79..d3b0af3cb80 100644 --- a/.github/workflows/ftp.yml +++ b/.github/workflows/ftp.yml @@ -21,14 +21,14 @@ jobs: # do not stop on another job's failure fail-fast: false matrix: - php-versions: ['7.4', '8.0'] + php-versions: ['8.0'] ftpd: ['proftpd', 'vsftpd', 'pure-ftpd'] name: php${{ matrix.php-versions }}-${{ matrix.ftpd }} steps: - name: Checkout server - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index 11590ffb04a..bcf039ad728 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@v1.1 diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml new file mode 100644 index 00000000000..b24ad95dac8 --- /dev/null +++ b/.github/workflows/lint-php-cs.yml @@ -0,0 +1,37 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +name: Lint + +on: pull_request + +permissions: + contents: read + +concurrency: + group: lint-php-cs-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + + name: php-cs + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up php + uses: shivammathur/setup-php@v2 + with: + php-version: "8.0" + coverage: none + + - name: Install dependencies + run: composer i + + - name: Lint + run: composer run cs:check || ( echo "Please run `composer run cs:fix` to format your code" && exit 1 ) diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml new file mode 100644 index 00000000000..ad3add22d60 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,57 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +name: Lint + +on: + pull_request: + push: + branches: + - main + - master + - stable* + +permissions: + contents: read + +concurrency: + group: lint-php-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + php-lint: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ["8.0", "8.1", "8.2"] + + name: php-lint + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: none + + - name: Lint + run: composer run lint + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: php-lint + + if: always() + + name: php-lint-summary + + steps: + - name: Summary status + run: if ${{ needs.php-lint.result != "success" && needs.php-lint.result != "skipped" }}; then exit 1; fi diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 983b0af6d93..00000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Lint -on: pull_request - -jobs: - php-linters: - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['7.4', '8.0', '8.1', '8.2'] - name: php${{ matrix.php-versions }} lint - steps: - - name: Checkout - uses: actions/checkout@master - - name: Set up php${{ matrix.php-versions }} - uses: shivammathur/setup-php@master - with: - php-version: ${{ matrix.php-versions }} - extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip - coverage: none - - name: Lint - run: composer run lint - - php-cs-fixer: - name: php-cs check - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@master - - name: Set up php - uses: shivammathur/setup-php@master - with: - php-version: 7.4 - extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip - coverage: none - tools: cs2pr - - name: Install dependencies - run: composer i - - name: Run coding standards check - run: | - composer run cs:check -- --format=checkstyle | cs2pr - composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) - shell: bash diff --git a/.github/workflows/node-tests.yml b/.github/workflows/node-tests.yml index 6be1006a937..596e4494e43 100644 --- a/.github/workflows/node-tests.yml +++ b/.github/workflows/node-tests.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@v1.1 @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up node ${{ needs.versions.outputs.nodeVersion }} uses: actions/setup-node@v2 @@ -53,7 +53,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up node ${{ needs.versions.outputs.nodeVersion }} uses: actions/setup-node@v2 @@ -75,7 +75,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up node ${{ needs.versions.outputs.nodeVersion }} uses: actions/setup-node@v2 diff --git a/.github/workflows/oci.yml b/.github/workflows/oci.yml index adcc48dc90d..089c3d32f6e 100644 --- a/.github/workflows/oci.yml +++ b/.github/workflows/oci.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - php-versions: [ '7.4', '8.0', '8.1'] + php-versions: ['8.0', '8.1', '8.2'] services: oracle: diff --git a/.github/workflows/psalm-github.yml b/.github/workflows/psalm-github.yml index d27e0a1f143..c682733e6c9 100644 --- a/.github/workflows/psalm-github.yml +++ b/.github/workflows/psalm-github.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Psalm diff --git a/.github/workflows/psalm-security.yml b/.github/workflows/psalm-security.yml index a97abba44c2..40f67dab6ce 100644 --- a/.github/workflows/psalm-security.yml +++ b/.github/workflows/psalm-security.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Psalm diff --git a/.github/workflows/s3-external.yml b/.github/workflows/s3-external.yml index 8c2cdd7cfd1..45b585c5295 100644 --- a/.github/workflows/s3-external.yml +++ b/.github/workflows/s3-external.yml @@ -21,7 +21,7 @@ jobs: # do not stop on another job's failure fail-fast: false matrix: - php-versions: ['7.4', '8.0'] + php-versions: ['8.0', '8.1'] name: php${{ matrix.php-versions }}-minio @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout server - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true @@ -70,7 +70,7 @@ jobs: # do not stop on another job's failure fail-fast: false matrix: - php-versions: ['7.4', '8.0'] + php-versions: ['8.0', '8.1'] name: php${{ matrix.php-versions }}-localstack @@ -85,7 +85,7 @@ jobs: steps: - name: Checkout server - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true diff --git a/.github/workflows/s3-primary.yml b/.github/workflows/s3-primary.yml index a6ee0970ada..50bab8965f5 100644 --- a/.github/workflows/s3-primary.yml +++ b/.github/workflows/s3-primary.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout server - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true diff --git a/.github/workflows/smb-kerberos.yml b/.github/workflows/smb-kerberos.yml index 2875a7f4fbd..a3f0598d845 100644 --- a/.github/workflows/smb-kerberos.yml +++ b/.github/workflows/smb-kerberos.yml @@ -17,13 +17,13 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.4', '8.0'] + php-versions: ['8.0', '8.1'] name: php${{ matrix.php-versions }}-${{ matrix.ftpd }} steps: - name: Checkout server - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true - name: Pull images diff --git a/.github/workflows/static-code-analysis.yml b/.github/workflows/static-code-analysis.yml index 31ee0f89fa2..a2d6577af8e 100644 --- a/.github/workflows/static-code-analysis.yml +++ b/.github/workflows/static-code-analysis.yml @@ -1,56 +1,61 @@ name: Static code analysis -on: [pull_request] +on: + pull_request: jobs: - static-code-analysis: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Checkout submodules - shell: bash - run: | - auth_header="$(git config --local --get http.https://github.com/.extraheader)" - git submodule sync --recursive - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - - name: Set up php7.4 - uses: shivammathur/setup-php@master - with: - php-version: 7.4 - extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip - coverage: none - - name: Composer install - run: composer i - - name: Psalm - run: composer run psalm -- --monochrome --no-progress --output-format=github --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 ) - - name: Check diff - run: git diff -- . ':!lib/composer' - - name: Show potential changes in Psalm baseline - run: | - bash -c "[[ ! \"`git status --porcelain build/psalm-baseline.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)" - - static-code-analysis-ocp: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Checkout submodules - shell: bash - run: | - auth_header="$(git config --local --get http.https://github.com/.extraheader)" - git submodule sync --recursive - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - - name: Set up php7.4 - uses: shivammathur/setup-php@master - with: - php-version: 7.4 - extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip - coverage: none - - name: Composer install - run: composer i - - name: Psalm - run: composer run psalm -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 ) - - name: Check diff - run: git diff -- . ':!lib/composer' - - name: Show potential changes in Psalm baseline - run: | - bash -c "[[ ! \"`git status --porcelain build/psalm-baseline-ocp.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)" + static-code-analysis: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + + - name: Set up php + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip + coverage: none + + - name: Composer install + run: composer i + + - name: Psalm + run: composer run psalm -- --monochrome --no-progress --output-format=github --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 ) + + - name: Check diff + run: git diff -- . ':!lib/composer' + + - name: Show potential changes in Psalm baseline + run: | + bash -c "[[ ! \"`git status --porcelain build/psalm-baseline.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)" + + static-code-analysis-ocp: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + + - name: Set up php + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip + coverage: none + + - name: Composer install + run: composer i + + - name: Psalm + run: composer run psalm -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 ) + + - name: Check diff + run: git diff -- . ':!lib/composer' + + - name: Show potential changes in Psalm baseline + run: | + bash -c "[[ ! \"`git status --porcelain build/psalm-baseline-ocp.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)" diff --git a/.github/workflows/update-psalm-baseline.yml b/.github/workflows/update-psalm-baseline.yml index 42f2d7450e7..fd73d555c86 100644 --- a/.github/workflows/update-psalm-baseline.yml +++ b/.github/workflows/update-psalm-baseline.yml @@ -22,10 +22,10 @@ jobs: ref: ${{ matrix.branches }} submodules: true - - name: Set up php7.4 + - name: Set up php uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: '8.0' extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip coverage: none -- 2.39.5