1717 CI : true
1818
1919jobs :
20- see_if_should_skip :
21- continue-on-error : true
22- runs-on : ubuntu-latest
23- # Map a step output to a job output
24- outputs :
25- should_skip : ${{ steps.skip_check.outputs.should_skip }}
26- steps :
27- - id : skip_check
28- uses : fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289
29- with :
30- cancel_others : ' false'
31- github_token : ${{ github.token }}
32- paths : ' [".github/workflows/test.yml", ".node-version", ".npmrc", "app.json", "content/**", "data/**","lib/**", "Dockerfile", "feature-flags.json", "Gemfile", "Gemfile.lock", "middleware/**", "node_modules/**","package.json", "package-lock.json", "server.js", "tests/**", "translations/**", "Procfile", "webpack.config.js"]'
33-
3420 test :
35- needs : see_if_should_skip
3621 # Run on self-hosted if the private repo or ubuntu-latest if the public repo
3722 # See pull # 17442 in the private repo for context
3823 runs-on : ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
@@ -44,51 +29,45 @@ jobs:
4429 steps :
4530 # Each of these ifs needs to be repeated at each step to make sure the required check still runs
4631 # Even if if doesn't do anything
47- - if : ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
48- name : Check out repo
32+ - name : Check out repo
4933 uses : actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
5034 with :
5135 # Enables cloning the Early Access repo later with the relevant PAT
5236 persist-credentials : ' false'
5337
54- - if : ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
55- name : Setup node
38+ - name : Setup node
5639 uses : actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
5740 with :
5841 node-version : 14.x
5942
60- - if : ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
61- name : Get npm cache directory
43+ - name : Get npm cache directory
6244 id : npm-cache
6345 run : |
6446 echo "::set-output name=dir::$(npm config get cache)"
6547
66- - if : ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
67- name : Cache node modules
48+ - name : Cache node modules
6849 uses : actions/cache@0781355a23dac32fd3bac414512f4b903437991a
6950 with :
7051 path : ${{ steps.npm-cache.outputs.dir }}
7152 key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
7253 restore-keys : |
7354 ${{ runner.os }}-node-
7455
75- - if : ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
76- name : Install dependencies
56+ - name : Install dependencies
7757 run : npm ci
7858
79- - if : ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository == 'github/docs-internal' }}
59+ - if : ${{ github.repository == 'github/docs-internal' }}
8060 name : Clone early access
8161 run : npm run heroku-postbuild
8262 env :
8363 DOCUBOT_REPO_PAT : ${{ secrets.DOCUBOT_REPO_PAT }}
8464 GIT_BRANCH : ${{ github.head_ref || github.ref }}
8565
86- - if : ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository != 'github/docs-internal' }}
66+ - if : ${{ github.repository != 'github/docs-internal' }}
8767 name : Run build script
8868 run : npm run build
8969
90- - if : ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
91- name : Run tests
70+ - name : Run tests
9271 run : npx jest tests/${{ matrix.test-group }}/
9372 env :
9473 NODE_OPTIONS : ' --max_old_space_size=4096'
0 commit comments