11name : Main CI
22on :
33 push :
4+ permissions : {}
5+ concurrency :
6+ group : ${{ github.workflow }}-${{ github.ref }}
7+ cancel-in-progress : false
48
59jobs :
610 get-vars :
711 uses : ./.github/workflows/nodevars.yml
812
913 main :
14+ name : Lint and Test
1015 needs : get-vars
1116 runs-on : ubuntu-latest
17+ permissions :
18+ contents : read
1219 steps :
1320 - name : Checkout
1421 uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
22+ with :
23+ persist-credentials : false
1524 - name : Setup node
1625 uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
1726 with :
1827 node-version : ${{ needs.get-vars.outputs.node-version }}
1928 cache : npm
2029 - name : Setup npm
21- run : npm i -g npm@${{ needs.get-vars.outputs.npm-version }}
30+ run : npm i -g npm@${NPM_VERSION}
31+ env :
32+ NPM_VERSION : ${{ needs.get-vars.outputs.npm-version }}
2233 - name : Cache node modules
2334 id : node_modules_cache
2435 uses : actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3.5.0
@@ -37,13 +48,16 @@ jobs:
3748 - name : Test
3849 run : npm run test
3950 windows-test :
51+ name : Test using Windows environment
4052 needs : get-vars
4153 runs-on : windows-latest
4254 env :
4355 TEST_IGNORE_256_ICON : 1
4456 steps :
4557 - name : Checkout
4658 uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
59+ with :
60+ persist-credentials : false
4761 - name : Setup node
4862 uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
4963 with :
6074 - name : Install
6175 if : steps.node_modules_cache.outputs.cache-hit != 'true'
6276 # use npx instead of installing npm globally to avoid permission error
63- run : npx -y npm@${{ needs.get-vars.outputs.npm-version }} ci
77+ run : npx -y npm@${NPM_VERSION} ci
78+ env :
79+ NPM_VERSION : ${{ needs.get-vars.outputs.npm-version }}
6480 - name : Test (x86)
6581 # use normal npm (which should not affect to the test)
6682 run : npm run test:win-x86
0 commit comments