Skip to content

Commit f8cbcaa

Browse files
authored
Merge pull request #605 from nextcloud-libraries/automated/update-workflows/default
chore: update workflows from templates
2 parents 162d320 + 151b621 commit f8cbcaa

9 files changed

Lines changed: 182 additions & 160 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+
name: Block unconventional commits
7+
8+
on:
9+
pull_request:
10+
types: [opened, ready_for_review, reopened, synchronize]
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: block-unconventional-commits-${{ github.head_ref || github.run_id }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
block-unconventional-commits:
21+
name: Block unconventional commits
22+
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
28+
29+
- uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7 # v1.3.0
30+
with:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/conventional_commits.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ concurrency:
2121

2222
jobs:
2323
auto-approve-merge:
24-
if: github.actor == 'dependabot[bot]'
24+
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
2525
runs-on: ubuntu-latest
2626
permissions:
2727
# for hmarr/auto-approve-action to approve PRs

.github/workflows/documentation.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,26 @@ jobs:
1212
name: Build and deploy
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
15+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1616

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

2424
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
25-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
25+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2626
with:
2727
node-version: ${{ steps.versions.outputs.nodeVersion }}
2828

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

3232
- name: Install dependencies & build
33+
env:
34+
CYPRESS_INSTALL_BINARY: 0
3335
run: |
3436
npm ci
3537
npm run build --if-present
@@ -38,7 +40,7 @@ jobs:
3840
- name: Deploy
3941
# Only deploy on release
4042
if: github.event.release
41-
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
43+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
4244
with:
4345
github_token: ${{ secrets.GITHUB_TOKEN }}
4446
publish_dir: ./dist/doc

.github/workflows/lint-eslint.yml

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,7 @@
88

99
name: Lint eslint
1010

11-
on:
12-
pull_request:
13-
paths:
14-
- '.github/workflows/**'
15-
- 'src/**'
16-
- 'appinfo/info.xml'
17-
- 'package.json'
18-
- 'package-lock.json'
19-
- 'tsconfig.json'
20-
- '.eslintrc.*'
21-
- '.eslintignore'
22-
- '**.js'
23-
- '**.ts'
24-
- '**.vue'
11+
on: pull_request
2512

2613
permissions:
2714
contents: read
@@ -31,32 +18,78 @@ concurrency:
3118
cancel-in-progress: true
3219

3320
jobs:
21+
changes:
22+
runs-on: ubuntu-latest
23+
24+
outputs:
25+
src: ${{ steps.changes.outputs.src}}
26+
27+
steps:
28+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
29+
id: changes
30+
continue-on-error: true
31+
with:
32+
filters: |
33+
src:
34+
- '.github/workflows/**'
35+
- 'src/**'
36+
- 'appinfo/info.xml'
37+
- 'package.json'
38+
- 'package-lock.json'
39+
- 'tsconfig.json'
40+
- '.eslintrc.*'
41+
- '.eslintignore'
42+
- '**.js'
43+
- '**.ts'
44+
- '**.vue'
45+
3446
lint:
3547
runs-on: ubuntu-latest
3648

37-
name: eslint
49+
needs: changes
50+
if: needs.changes.outputs.src != 'false'
51+
52+
name: NPM lint
3853

3954
steps:
4055
- name: Checkout
41-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
56+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4257

4358
- name: Read package.json node and npm engines version
4459
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
4560
id: versions
4661
with:
4762
fallbackNode: '^20'
48-
fallbackNpm: '^9'
63+
fallbackNpm: '^10'
4964

5065
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
51-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
66+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
5267
with:
5368
node-version: ${{ steps.versions.outputs.nodeVersion }}
5469

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

5873
- name: Install dependencies
74+
env:
75+
CYPRESS_INSTALL_BINARY: 0
76+
PUPPETEER_SKIP_DOWNLOAD: true
5977
run: npm ci
6078

6179
- name: Lint
6280
run: npm run lint
81+
82+
summary:
83+
permissions:
84+
contents: none
85+
runs-on: ubuntu-latest
86+
needs: [changes, lint]
87+
88+
if: always()
89+
90+
# This is the summary, we just avoid to rename it so that branch protection rules still match
91+
name: eslint
92+
93+
steps:
94+
- name: Summary status
95+
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

.github/workflows/node-test.yml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,59 @@ concurrency:
1616
cancel-in-progress: true
1717

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

47+
needs: changes
48+
if: needs.changes.outputs.src != 'false'
49+
2250
steps:
2351
- name: Checkout
24-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
52+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2553

2654
- name: Read package.json node and npm engines version
2755
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
2856
id: versions
2957
with:
3058
fallbackNode: '^20'
31-
fallbackNpm: '^9'
59+
fallbackNpm: '^10'
3260

3361
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
34-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
62+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
3563
with:
3664
node-version: ${{ steps.versions.outputs.nodeVersion }}
3765

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

4169
- name: Install dependencies & build
70+
env:
71+
CYPRESS_INSTALL_BINARY: 0
4272
run: |
4373
npm ci
4474
npm run build --if-present
@@ -48,18 +78,22 @@ jobs:
4878

4979
- name: Test and process coverage
5080
run: npm run test:coverage --if-present
51-
81+
5282
- name: Collect coverage
53-
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
83+
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
5484
with:
5585
files: ./coverage/lcov.info
5686

5787
summary:
88+
permissions:
89+
contents: none
5890
runs-on: ubuntu-latest
59-
needs: test
91+
needs: [changes, test]
92+
6093
if: always()
6194

6295
name: test-summary
96+
6397
steps:
6498
- name: Summary status
65-
run: if ${{ needs.test.result != 'success' && needs.test.result != 'skipped' }}; then exit 1; fi
99+
run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi

.github/workflows/node.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)