38
38
run : |
39
39
git config --global core.autocrlf false
40
40
git config --global core.eol lf
41
+ shell : bash
41
42
- name : Checkout repository
42
- uses : actions/checkout@v3
43
+ uses : actions/checkout@v4
43
44
- name : Check if Node.js project and has package.json
44
45
id : packagejson
45
46
run : test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
@@ -50,14 +51,18 @@ jobs:
50
51
id : lockversion
51
52
- if : steps.packagejson.outputs.exists == 'true'
52
53
name : Setup Node.js
53
- uses : actions/setup-node@v3
54
+ uses : actions/setup-node@v4
54
55
with :
55
56
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]
58
62
- if : steps.packagejson.outputs.exists == 'true'
59
63
name : Install dependencies
60
- run : npm install
64
+ shell : bash
65
+ run : npm ci
61
66
- if : steps.packagejson.outputs.exists == 'true'
62
67
name : Run test
63
68
run : npm test --if-present
81
86
git config --global core.autocrlf false
82
87
git config --global core.eol lf
83
88
- name : Checkout repository
84
- uses : actions/checkout@v3
89
+ uses : actions/checkout@v4
85
90
- name : Check if Node.js project and has package.json
86
91
id : packagejson
87
92
run : test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
@@ -92,21 +97,13 @@ jobs:
92
97
id : lockversion
93
98
- if : steps.packagejson.outputs.exists == 'true'
94
99
name : Setup Node.js
95
- uses : actions/setup-node@v3
100
+ uses : actions/setup-node@v4
96
101
with :
97
102
node-version : " ${{ steps.lockversion.outputs.version }}"
98
- cache : ' npm'
99
- cache-dependency-path : ' **/package-lock.json'
100
103
- if : steps.packagejson.outputs.exists == 'true'
101
104
name : Install dependencies
102
- id : first-installation
105
+ shell : bash
103
106
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
110
107
- if : steps.packagejson.outputs.exists == 'true'
111
108
name : Add plugin for conventional commits for semantic-release
112
109
run :
npm install --save-dev [email protected]
@@ -131,4 +128,4 @@ jobs:
131
128
fields : repo,action,workflow
132
129
text : ' Release workflow failed in release job'
133
130
env :
134
- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
131
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
0 commit comments