Skip to content

Commit 8940896

Browse files
committed
chore: update workflows from templates
Signed-off-by: skjnldsv <[email protected]>
1 parent a6700f1 commit 8940896

File tree

10 files changed

+316
-182
lines changed

10 files changed

+316
-182
lines changed

.github/workflows/appstore-build-publish.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
release:
1010
types: [published]
1111

12-
env:
13-
PHP_VERSION: 8.1
14-
1512
jobs:
1613
build_and_publish:
1714
runs-on: ubuntu-latest
@@ -21,7 +18,7 @@ jobs:
2118

2219
steps:
2320
- name: Check actor permission
24-
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
21+
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
2522
with:
2623
require: write
2724

@@ -32,7 +29,7 @@ jobs:
3229
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3330
3431
- name: Checkout
35-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
32+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3633
with:
3734
path: ${{ env.APP_NAME }}
3835

@@ -51,12 +48,12 @@ jobs:
5148
with:
5249
path: ${{ env.APP_NAME }}
5350
fallbackNode: '^20'
54-
fallbackNpm: '^9'
51+
fallbackNpm: '^10'
5552

5653
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
5754
# Skip if no package.json
5855
if: ${{ steps.versions.outputs.nodeVersion }}
59-
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
56+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
6057
with:
6158
node-version: ${{ steps.versions.outputs.nodeVersion }}
6259

@@ -65,17 +62,23 @@ jobs:
6562
if: ${{ steps.versions.outputs.npmVersion }}
6663
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
6764

68-
- name: Set up php ${{ env.PHP_VERSION }}
69-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
65+
- name: Get php version
66+
id: php-versions
67+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
7068
with:
71-
php-version: ${{ env.PHP_VERSION }}
69+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
70+
71+
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
72+
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
73+
with:
74+
php-version: ${{ steps.php-versions.outputs.php-min }}
7275
coverage: none
7376
env:
7477
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7578

7679
- name: Check composer.json
7780
id: check_composer
78-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
81+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
7982
with:
8083
files: "${{ env.APP_NAME }}/composer.json"
8184

@@ -88,14 +91,16 @@ jobs:
8891
- name: Build ${{ env.APP_NAME }}
8992
# Skip if no package.json
9093
if: ${{ steps.versions.outputs.nodeVersion }}
94+
env:
95+
CYPRESS_INSTALL_BINARY: 0
9196
run: |
9297
cd ${{ env.APP_NAME }}
9398
npm ci
9499
npm run build
95100
96101
- name: Check Krankerl config
97102
id: krankerl
98-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
103+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
99104
with:
100105
files: ${{ env.APP_NAME }}/krankerl.toml
101106

@@ -126,7 +131,7 @@ jobs:
126131
unzip latest-$NCVERSION.zip
127132
128133
- name: Checkout server master fallback
129-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
134+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
130135
if: ${{ steps.server-checkout.outcome != 'success' }}
131136
with:
132137
submodules: true
@@ -149,7 +154,7 @@ jobs:
149154
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
150155
151156
- name: Attach tarball to github release
152-
uses: svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2
157+
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
153158
id: attach_to_release
154159
with:
155160
repo_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dependabot-approve-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ concurrency:
2222
jobs:
2323
auto-approve-merge:
2424
if: github.actor == 'dependabot[bot]'
25-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-latest-low
2626
permissions:
2727
# for hmarr/auto-approve-action to approve PRs
2828
pull-requests: write

.github/workflows/lint-info-xml.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55

66
name: Lint info.xml
77

8-
on:
9-
pull_request:
10-
push:
11-
branches:
12-
- main
13-
- master
14-
- stable*
8+
on: pull_request
159

1610
permissions:
1711
contents: read
@@ -22,18 +16,18 @@ concurrency:
2216

2317
jobs:
2418
xml-linters:
25-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-latest-low
2620

2721
name: info.xml lint
2822
steps:
2923
- name: Checkout
30-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3125

3226
- name: Download schema
3327
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
3428

3529
- name: Lint info.xml
36-
uses: ChristophWurst/xmllint-action@39155a91429af431d65fafc21fa52ba5c4f5cb71 # v1.1
30+
uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2
3731
with:
3832
xml-file: ./appinfo/info.xml
3933
xml-schema-file: ./info.xsd

.github/workflows/lint-php-cs.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,17 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
25+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2626

27-
- name: Set up php
28-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
27+
- name: Get php version
28+
id: versions
29+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
30+
31+
- name: Set up php${{ steps.versions.outputs.php-available }}
32+
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
2933
with:
30-
php-version: 8.1
34+
php-version: ${{ steps.versions.outputs.php-available }}
35+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3136
coverage: none
3237
ini-file: development
3338
env:

.github/workflows/lint-php.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55

66
name: Lint php
77

8-
on:
9-
pull_request:
10-
push:
11-
branches:
12-
- main
13-
- master
14-
- stable*
8+
on: pull_request
159

1610
permissions:
1711
contents: read
@@ -21,22 +15,35 @@ concurrency:
2115
cancel-in-progress: true
2216

2317
jobs:
18+
matrix:
19+
runs-on: ubuntu-latest-low
20+
outputs:
21+
php-versions: ${{ steps.versions.outputs.php-versions }}
22+
steps:
23+
- name: Checkout app
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25+
- name: Get version matrix
26+
id: versions
27+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
28+
2429
php-lint:
2530
runs-on: ubuntu-latest
31+
needs: matrix
2632
strategy:
2733
matrix:
28-
php-versions: [ "8.0", "8.1", "8.2" ]
34+
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
2935

3036
name: php-lint
3137

3238
steps:
3339
- name: Checkout
34-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
40+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3541

3642
- name: Set up php ${{ matrix.php-versions }}
37-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
43+
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
3844
with:
3945
php-version: ${{ matrix.php-versions }}
46+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
4047
coverage: none
4148
ini-file: development
4249
env:
@@ -48,7 +55,7 @@ jobs:
4855
summary:
4956
permissions:
5057
contents: none
51-
runs-on: ubuntu-latest
58+
runs-on: ubuntu-latest-low
5259
needs: php-lint
5360

5461
if: always()

.github/workflows/node.yml

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,7 @@
55

66
name: Node
77

8-
on:
9-
pull_request:
10-
paths:
11-
- '.github/workflows/**'
12-
- 'src/**'
13-
- 'appinfo/info.xml'
14-
- 'package.json'
15-
- 'package-lock.json'
16-
- 'tsconfig.json'
17-
- '**.js'
18-
- '**.ts'
19-
- '**.vue'
20-
push:
21-
branches:
22-
- main
23-
- master
24-
- stable*
8+
on: pull_request
259

2610
permissions:
2711
contents: read
@@ -31,30 +15,59 @@ concurrency:
3115
cancel-in-progress: true
3216

3317
jobs:
18+
changes:
19+
runs-on: ubuntu-latest-low
20+
21+
outputs:
22+
src: ${{ steps.changes.outputs.src}}
23+
24+
steps:
25+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
26+
id: changes
27+
continue-on-error: true
28+
with:
29+
filters: |
30+
src:
31+
- '.github/workflows/**'
32+
- 'src/**'
33+
- 'appinfo/info.xml'
34+
- 'package.json'
35+
- 'package-lock.json'
36+
- 'tsconfig.json'
37+
- '**.js'
38+
- '**.ts'
39+
- '**.vue'
40+
3441
build:
3542
runs-on: ubuntu-latest
3643

37-
name: node
44+
needs: changes
45+
if: needs.changes.outputs.src != 'false'
46+
47+
name: NPM build
3848
steps:
3949
- name: Checkout
40-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
50+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4151

4252
- name: Read package.json node and npm engines version
4353
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
4454
id: versions
4555
with:
4656
fallbackNode: '^20'
47-
fallbackNpm: '^9'
57+
fallbackNpm: '^10'
4858

4959
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
50-
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
60+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
5161
with:
5262
node-version: ${{ steps.versions.outputs.nodeVersion }}
5363

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

5767
- name: Install dependencies & build
68+
env:
69+
CYPRESS_INSTALL_BINARY: 0
70+
PUPPETEER_SKIP_DOWNLOAD: true
5871
run: |
5972
npm ci
6073
npm run build --if-present
@@ -69,3 +82,18 @@ jobs:
6982
git status
7083
git --no-pager diff
7184
exit 1 # make it red to grab attention
85+
86+
summary:
87+
permissions:
88+
contents: none
89+
runs-on: ubuntu-latest-low
90+
needs: [changes, build]
91+
92+
if: always()
93+
94+
# This is the summary, we just avoid to rename it so that branch protection rules still match
95+
name: node
96+
97+
steps:
98+
- name: Summary status
99+
run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)