Skip to content

Commit

Permalink
chore: update workflows from templates
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv authored and juliushaertl committed Feb 8, 2024
1 parent 5559721 commit 2864276
Show file tree
Hide file tree
Showing 16 changed files with 170 additions and 102 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/block-merge-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

if: github.event.pull_request.draft == false

runs-on: ubuntu-latest
runs-on: ubuntu-latest-low

steps:
- name: Register text Git reference
- 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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependabot-approve-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ concurrency:

jobs:
auto-approve-merge:
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest-low
permissions:
# for hmarr/auto-approve-action to approve PRs
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fixup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint-eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: changes
continue-on-error: true
with:
Expand Down Expand Up @@ -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 }}

Expand All @@ -82,7 +82,7 @@ jobs:
summary:
permissions:
contents: none
runs-on: ubuntu-latest
runs-on: ubuntu-latest-low
needs: [changes, lint]

if: always()
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up php
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
- 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:
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@

name: Lint php

on:
pull_request:
push:
branches:
- main
- master
- stable*
on: pull_request

permissions:
contents: read
Expand All @@ -25,18 +19,19 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ "8.0", "8.1", "8.2", "8.3" ]
php-versions: [ '8.0', '8.1', '8.2', '8.3' ]

name: php-lint

steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
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:
Expand All @@ -48,7 +43,7 @@ jobs:
summary:
permissions:
contents: none
runs-on: ubuntu-latest
runs-on: ubuntu-latest-low
needs: php-lint

if: always()
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/lint-stylelint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,26 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
id: versions
with:
fallbackNode: '^20'
fallbackNpm: '^9'
fallbackNpm: '^10'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Install dependencies
env:
CYPRESS_INSTALL_BINARY: 0
run: npm ci

- name: Lint
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: changes
continue-on-error: true
with:
Expand Down Expand Up @@ -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 }}

Expand All @@ -71,19 +71,22 @@ jobs:
run: |
npm ci
npm run build --if-present
npm run stats --if-present
- name: Send bundle stats to RelativeCI
uses: relative-ci/agent-action@e92b0c712e5ad0a039faf1026cbe438b8e7fed16 # v2
with:
webpackStatsFile: ./webpack-stats.json
key: ${{ secrets.RELATIVE_CI_KEY }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check webpack build changes
run: |
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
- name: Show changes on failure
if: failure()
run: |
git status
git --no-pager diff
exit 1 # make it red to grab attention
summary:
permissions:
contents: none
runs-on: ubuntu-latest
runs-on: ubuntu-latest-low
needs: [changes, build]

if: always()
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/npm-audit-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
strategy:
fail-fast: false
matrix:
branches: ["main", "stable28", "stable27", "stable26", "stable25", "stable24"]
branches: ['main', 'master', 'stable28', 'stable27', 'stable26']

name: npm-audit-fix-${{ matrix.branches }}

steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ matrix.branches }}

Expand All @@ -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@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

Expand All @@ -48,12 +48,16 @@ jobs:
npm audit fix
- name: Run npm ci and npm run build
if: always()
env:
CYPRESS_INSTALL_BINARY: 0
run: |
npm ci
npm run build --if-present
- name: Create Pull Request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5
if: always()
uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v5
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
commit-message: "chore(deps): fix npm audit"
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/phpunit-mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: changes
continue-on-error: true
with:
Expand All @@ -42,14 +55,14 @@ jobs:
phpunit-mariadb:
runs-on: ubuntu-latest

needs: changes
needs: [changes, matrix]
if: needs.changes.outputs.src != 'false'

strategy:
matrix:
php-versions: ['8.2']
php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
mariadb-versions: ['10.6', '10.11']
server-versions: ['master']

name: MariaDB ${{ matrix.mariadb-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}

Expand Down Expand Up @@ -81,7 +94,7 @@ jobs:
path: apps/${{ env.APP_NAME }}

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
Expand All @@ -98,7 +111,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

Expand Down Expand Up @@ -162,7 +175,7 @@ jobs:
summary:
permissions:
contents: none
runs-on: ubuntu-latest
runs-on: ubuntu-latest-low
needs: [changes, phpunit-mariadb]

if: always()
Expand Down
Loading

0 comments on commit 2864276

Please sign in to comment.