From f58b6a02a2a1648de3e23a0f8e8ff0dbe692b25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Mon, 5 Feb 2024 17:10:07 +0100 Subject: [PATCH] chore: update workflows from templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .github/workflows/block-merge-freeze.yml | 10 +++++-- .../workflows/dependabot-approve-merge.yml | 2 +- .github/workflows/fixup.yml | 2 +- .github/workflows/lint-eslint.yml | 10 +++---- .github/workflows/lint-info-xml.yml | 2 +- .github/workflows/lint-php-cs.yml | 3 +- .github/workflows/lint-php.yml | 3 +- .github/workflows/lint-stylelint.yml | 4 +-- .github/workflows/node.yml | 10 +++---- .github/workflows/npm-audit-fix.yml | 6 ++-- .github/workflows/phpunit-mysql.yml | 29 +++++++++++++------ .github/workflows/phpunit-oci.yml | 27 ++++++++++++----- .github/workflows/phpunit-pgsql.yml | 27 ++++++++++++----- .github/workflows/phpunit-sqlite.yml | 27 ++++++++++++----- .github/workflows/update-nextcloud-ocp.yml | 2 +- 15 files changed, 110 insertions(+), 54 deletions(-) diff --git a/.github/workflows/block-merge-freeze.yml b/.github/workflows/block-merge-freeze.yml index f2d029c9..2e4b3e25 100644 --- a/.github/workflows/block-merge-freeze.yml +++ b/.github/workflows/block-merge-freeze.yml @@ -22,11 +22,15 @@ jobs: if: github.event.pull_request.draft == false - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low steps: - - name: Download version.php from ${{ github.base_ref }} - run: curl https://github.com/raw/nextcloud/server/${{ github.base_ref }}/version.php --output version.php + - name: Register server reference to fallback to master branch + run: | + server_ref="$(if [ "${{ github.base_ref }}" = "main" ]; then echo -n "master"; else echo -n "${{ github.base_ref }}"; fi)" + echo "server_ref=$server_ref" >> $GITHUB_ENV + - name: Download version.php from ${{ env.server_ref }} + run: curl https://github.com/raw/nextcloud/server/${{ env.server_ref }}/version.php --output version.php - name: Run check run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC' diff --git a/.github/workflows/dependabot-approve-merge.yml b/.github/workflows/dependabot-approve-merge.yml index 9951547f..00b01961 100644 --- a/.github/workflows/dependabot-approve-merge.yml +++ b/.github/workflows/dependabot-approve-merge.yml @@ -22,7 +22,7 @@ concurrency: jobs: auto-approve-merge: if: github.actor == 'dependabot[bot]' - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low permissions: # for hmarr/auto-approve-action to approve PRs pull-requests: write diff --git a/.github/workflows/fixup.yml b/.github/workflows/fixup.yml index 9548d19f..98d49927 100644 --- a/.github/workflows/fixup.yml +++ b/.github/workflows/fixup.yml @@ -24,7 +24,7 @@ jobs: pull-requests: write name: Block fixup and squash commits - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low steps: - name: Run check diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index a33845e3..5344620b 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -19,13 +19,13 @@ concurrency: jobs: changes: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low outputs: src: ${{ steps.changes.outputs.src}} steps: - - uses: dorny/paths-filter@7267a8516b6f92bdb098633497bad573efdbf271 # v2.12.0 + - uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 id: changes continue-on-error: true with: @@ -60,10 +60,10 @@ jobs: id: versions with: fallbackNode: '^20' - fallbackNpm: '^9' + fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3 + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3 with: node-version: ${{ steps.versions.outputs.nodeVersion }} @@ -82,7 +82,7 @@ jobs: summary: permissions: contents: none - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low needs: [changes, lint] if: always() diff --git a/.github/workflows/lint-info-xml.yml b/.github/workflows/lint-info-xml.yml index bf6f1787..492e8a01 100644 --- a/.github/workflows/lint-info-xml.yml +++ b/.github/workflows/lint-info-xml.yml @@ -16,7 +16,7 @@ concurrency: jobs: xml-linters: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low name: info.xml lint steps: diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml index db00ec58..bfdcb146 100644 --- a/.github/workflows/lint-php-cs.yml +++ b/.github/workflows/lint-php-cs.yml @@ -27,7 +27,8 @@ jobs: - name: Set up php8.2 uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2 with: - php-version: 8.1 + php-version: 8.2 + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none ini-file: development env: diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml index aacae569..ace42769 100644 --- a/.github/workflows/lint-php.yml +++ b/.github/workflows/lint-php.yml @@ -31,6 +31,7 @@ jobs: uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2 with: php-version: ${{ matrix.php-versions }} + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none ini-file: development env: @@ -42,7 +43,7 @@ jobs: summary: permissions: contents: none - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low needs: php-lint if: always() diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml index 684bb619..a736046d 100644 --- a/.github/workflows/lint-stylelint.yml +++ b/.github/workflows/lint-stylelint.yml @@ -29,10 +29,10 @@ jobs: id: versions with: fallbackNode: '^20' - fallbackNpm: '^9' + fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3 + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 4fada6a4..b11e9cef 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -16,13 +16,13 @@ concurrency: jobs: changes: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low outputs: src: ${{ steps.changes.outputs.src}} steps: - - uses: dorny/paths-filter@7267a8516b6f92bdb098633497bad573efdbf271 # v2.12.0 + - uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 id: changes continue-on-error: true with: @@ -54,10 +54,10 @@ jobs: id: versions with: fallbackNode: '^20' - fallbackNpm: '^9' + fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3 + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3 with: node-version: ${{ steps.versions.outputs.nodeVersion }} @@ -86,7 +86,7 @@ jobs: summary: permissions: contents: none - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low needs: [changes, build] if: always() diff --git a/.github/workflows/npm-audit-fix.yml b/.github/workflows/npm-audit-fix.yml index 39ccd584..33ea8029 100644 --- a/.github/workflows/npm-audit-fix.yml +++ b/.github/workflows/npm-audit-fix.yml @@ -33,10 +33,10 @@ jobs: id: versions with: fallbackNode: '^20' - fallbackNpm: '^9' + fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3 + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3 with: node-version: ${{ steps.versions.outputs.nodeVersion }} @@ -57,7 +57,7 @@ jobs: - name: Create Pull Request if: always() - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5 + uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v5 with: token: ${{ secrets.COMMAND_BOT_PAT }} commit-message: "chore(deps): fix npm audit" diff --git a/.github/workflows/phpunit-mysql.yml b/.github/workflows/phpunit-mysql.yml index 678cf5a0..4e3bd5ee 100644 --- a/.github/workflows/phpunit-mysql.yml +++ b/.github/workflows/phpunit-mysql.yml @@ -15,14 +15,28 @@ concurrency: cancel-in-progress: true jobs: + matrix: + runs-on: ubuntu-latest-low + outputs: + matrix: ${{ steps.versions.outputs.sparse-matrix }} + steps: + - name: Checkout app + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Get version matrix + id: versions + uses: icewind1991/nextcloud-version-matrix@d594a6929da316b732c53355e52a1ead77ba36c7 # v1.2.0 + with: + matrix: '{"mysql-versions": ["8.1"]}' + changes: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low outputs: src: ${{ steps.changes.outputs.src}} steps: - - uses: dorny/paths-filter@7267a8516b6f92bdb098633497bad573efdbf271 # v2.12.0 + - uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 id: changes continue-on-error: true with: @@ -42,14 +56,11 @@ jobs: phpunit-mysql: runs-on: ubuntu-latest - needs: changes + needs: [changes, matrix] if: needs.changes.outputs.src != 'false' strategy: - matrix: - php-versions: ['8.0', '8.1', '8.2', '8.3'] - server-versions: ['master'] - mysql-versions: ['8.1'] + matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} @@ -98,7 +109,7 @@ jobs: - name: Check composer file existence id: check_composer - uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2 + uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2 with: files: apps/${{ env.APP_NAME }}/composer.json @@ -162,7 +173,7 @@ jobs: summary: permissions: contents: none - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low needs: [changes, phpunit-mysql] if: always() diff --git a/.github/workflows/phpunit-oci.yml b/.github/workflows/phpunit-oci.yml index 889466f1..d18ef028 100644 --- a/.github/workflows/phpunit-oci.yml +++ b/.github/workflows/phpunit-oci.yml @@ -15,14 +15,27 @@ concurrency: cancel-in-progress: true jobs: + matrix: + runs-on: ubuntu-latest-low + outputs: + php-max: ${{ steps.versions.outputs.php-max-list }} + server-max: ${{ steps.versions.outputs.branches-max-list }} + steps: + - name: Checkout app + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Get version matrix + id: versions + uses: icewind1991/nextcloud-version-matrix@d594a6929da316b732c53355e52a1ead77ba36c7 # v1.2.0 + changes: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low outputs: src: ${{ steps.changes.outputs.src}} steps: - - uses: dorny/paths-filter@7267a8516b6f92bdb098633497bad573efdbf271 # v2.12.0 + - uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 id: changes continue-on-error: true with: @@ -42,13 +55,13 @@ jobs: phpunit-oci: runs-on: ubuntu-22.04 - needs: changes + needs: [changes, matrix] if: needs.changes.outputs.src != 'false' strategy: matrix: - php-versions: ['8.2'] - server-versions: ['master'] + php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }} + server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} services: oracle: @@ -102,7 +115,7 @@ jobs: - name: Check composer file existence id: check_composer - uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2 + uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2 with: files: apps/${{ env.APP_NAME }}/composer.json @@ -166,7 +179,7 @@ jobs: summary: permissions: contents: none - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low needs: [changes, phpunit-oci] if: always() diff --git a/.github/workflows/phpunit-pgsql.yml b/.github/workflows/phpunit-pgsql.yml index 07c959bc..7111f301 100644 --- a/.github/workflows/phpunit-pgsql.yml +++ b/.github/workflows/phpunit-pgsql.yml @@ -15,14 +15,27 @@ concurrency: cancel-in-progress: true jobs: + matrix: + runs-on: ubuntu-latest-low + outputs: + php-max: ${{ steps.versions.outputs.php-max-list }} + server-max: ${{ steps.versions.outputs.branches-max-list }} + steps: + - name: Checkout app + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Get version matrix + id: versions + uses: icewind1991/nextcloud-version-matrix@d594a6929da316b732c53355e52a1ead77ba36c7 # v1.2.0 + changes: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low outputs: src: ${{ steps.changes.outputs.src}} steps: - - uses: dorny/paths-filter@7267a8516b6f92bdb098633497bad573efdbf271 # v2.12.0 + - uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 id: changes continue-on-error: true with: @@ -42,13 +55,13 @@ jobs: phpunit-pgsql: runs-on: ubuntu-latest - needs: changes + needs: [changes, matrix] if: needs.changes.outputs.src != 'false' strategy: matrix: - php-versions: ['8.2'] - server-versions: ['master'] + php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }} + server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} services: postgres: @@ -92,7 +105,7 @@ jobs: - name: Check composer file existence id: check_composer - uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2 + uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2 with: files: apps/${{ env.APP_NAME }}/composer.json @@ -156,7 +169,7 @@ jobs: summary: permissions: contents: none - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low needs: [changes, phpunit-pgsql] if: always() diff --git a/.github/workflows/phpunit-sqlite.yml b/.github/workflows/phpunit-sqlite.yml index eeb3453f..1deb1bdd 100644 --- a/.github/workflows/phpunit-sqlite.yml +++ b/.github/workflows/phpunit-sqlite.yml @@ -15,14 +15,27 @@ concurrency: cancel-in-progress: true jobs: + matrix: + runs-on: ubuntu-latest-low + outputs: + php-max: ${{ steps.versions.outputs.php-max-list }} + server-max: ${{ steps.versions.outputs.branches-max-list }} + steps: + - name: Checkout app + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Get version matrix + id: versions + uses: icewind1991/nextcloud-version-matrix@d594a6929da316b732c53355e52a1ead77ba36c7 # v1.2.0 + changes: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low outputs: src: ${{ steps.changes.outputs.src}} steps: - - uses: dorny/paths-filter@7267a8516b6f92bdb098633497bad573efdbf271 # v2.12.0 + - uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 id: changes continue-on-error: true with: @@ -42,13 +55,13 @@ jobs: phpunit-sqlite: runs-on: ubuntu-latest - needs: changes + needs: [changes, matrix] if: needs.changes.outputs.src != 'false' strategy: matrix: - php-versions: ['8.2'] - server-versions: ['master'] + php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }} + server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} steps: - name: Set app env @@ -81,7 +94,7 @@ jobs: - name: Check composer file existence id: check_composer - uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2 + uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2 with: files: apps/${{ env.APP_NAME }}/composer.json @@ -145,7 +158,7 @@ jobs: summary: permissions: contents: none - runs-on: ubuntu-latest + runs-on: ubuntu-latest-low needs: [changes, phpunit-sqlite] if: always() diff --git a/.github/workflows/update-nextcloud-ocp.yml b/.github/workflows/update-nextcloud-ocp.yml index f0604fff..b71c21a3 100644 --- a/.github/workflows/update-nextcloud-ocp.yml +++ b/.github/workflows/update-nextcloud-ocp.yml @@ -100,7 +100,7 @@ jobs: - name: Create Pull Request if: steps.checkout.outcome == 'success' - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v3 + uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v3 with: token: ${{ secrets.COMMAND_BOT_PAT }} commit-message: "chore(dev-deps): Bump nextcloud/ocp package"