Skip to content

Commit 75aa3f2

Browse files
authored
ci: update of files from global .github repo (#983)
1 parent 8eee392 commit 75aa3f2

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed

.github/workflows/if-nodejs-pr-testing.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ jobs:
3939
run: |
4040
git config --global core.autocrlf false
4141
git config --global core.eol lf
42+
shell: bash
4243
- if: steps.should_run.outputs.shouldrun == 'true'
4344
name: Checkout repository
44-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
4546
- if: steps.should_run.outputs.shouldrun == 'true'
4647
name: Check if Node.js project and has package.json
4748
id: packagejson
@@ -53,27 +54,26 @@ jobs:
5354
id: lockversion
5455
- if: steps.packagejson.outputs.exists == 'true'
5556
name: Setup Node.js
56-
uses: actions/setup-node@v3
57+
uses: actions/setup-node@v4
5758
with:
5859
node-version: "${{ steps.lockversion.outputs.version }}"
59-
cache: 'npm'
60-
cache-dependency-path: '**/package-lock.json'
60+
- if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest'
61+
#npm cli 10 is buggy because of some cache issue
62+
name: Install npm cli 8
63+
shell: bash
64+
run: npm install -g [email protected]
6165
- if: steps.packagejson.outputs.exists == 'true'
6266
name: Install dependencies
63-
id: first-installation
67+
shell: bash
6468
run: npm ci
65-
continue-on-error: true
66-
- if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true'
67-
name: Clear NPM cache and install deps again
68-
run: |
69-
npm cache clean --force
70-
npm ci
7169
- if: steps.packagejson.outputs.exists == 'true'
7270
name: Test
7371
run: npm test --if-present
74-
- if: steps.packagejson.outputs.exists == 'true'
72+
- if: steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest'
73+
#linting should run just one and not on all possible operating systems
7574
name: Run linter
7675
run: npm run lint --if-present
7776
- if: steps.packagejson.outputs.exists == 'true'
7877
name: Run release assets generation to make sure PR does not break it
78+
shell: bash
7979
run: npm run generate:assets --if-present

.github/workflows/if-nodejs-release.yml

+14-17
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ jobs:
3838
run: |
3939
git config --global core.autocrlf false
4040
git config --global core.eol lf
41+
shell: bash
4142
- name: Checkout repository
42-
uses: actions/checkout@v3
43+
uses: actions/checkout@v4
4344
- name: Check if Node.js project and has package.json
4445
id: packagejson
4546
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
@@ -50,14 +51,18 @@ jobs:
5051
id: lockversion
5152
- if: steps.packagejson.outputs.exists == 'true'
5253
name: Setup Node.js
53-
uses: actions/setup-node@v3
54+
uses: actions/setup-node@v4
5455
with:
5556
node-version: "${{ steps.lockversion.outputs.version }}"
56-
cache: 'npm'
57-
cache-dependency-path: '**/package-lock.json'
57+
- if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest'
58+
name: Install npm cli 8
59+
shell: bash
60+
#npm cli 10 is buggy because of some cache issues
61+
run: npm install -g [email protected]
5862
- if: steps.packagejson.outputs.exists == 'true'
5963
name: Install dependencies
60-
run: npm install
64+
shell: bash
65+
run: npm ci
6166
- if: steps.packagejson.outputs.exists == 'true'
6267
name: Run test
6368
run: npm test --if-present
@@ -81,7 +86,7 @@ jobs:
8186
git config --global core.autocrlf false
8287
git config --global core.eol lf
8388
- name: Checkout repository
84-
uses: actions/checkout@v3
89+
uses: actions/checkout@v4
8590
- name: Check if Node.js project and has package.json
8691
id: packagejson
8792
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
@@ -92,21 +97,13 @@ jobs:
9297
id: lockversion
9398
- if: steps.packagejson.outputs.exists == 'true'
9499
name: Setup Node.js
95-
uses: actions/setup-node@v3
100+
uses: actions/setup-node@v4
96101
with:
97102
node-version: "${{ steps.lockversion.outputs.version }}"
98-
cache: 'npm'
99-
cache-dependency-path: '**/package-lock.json'
100103
- if: steps.packagejson.outputs.exists == 'true'
101104
name: Install dependencies
102-
id: first-installation
105+
shell: bash
103106
run: npm ci
104-
continue-on-error: true
105-
- if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true'
106-
name: Clear NPM cache and install deps again
107-
run: |
108-
npm cache clean --force
109-
npm ci
110107
- if: steps.packagejson.outputs.exists == 'true'
111108
name: Add plugin for conventional commits for semantic-release
112109
run: npm install --save-dev [email protected]
@@ -131,4 +128,4 @@ jobs:
131128
fields: repo,action,workflow
132129
text: 'Release workflow failed in release job'
133130
env:
134-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
131+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

0 commit comments

Comments
 (0)