@@ -3,144 +3,64 @@ name: CI
33on :
44 push :
55 branches :
6+ - main
67 - master
7- pull_request :
8+ pull_request : {}
89
9- env :
10- NODE_VERSION : ' 14.x'
10+ concurrency :
11+ group : ci-${{ github.head_ref || github.ref }}
12+ cancel-in-progress : true
1113
1214jobs :
13- lint :
14- name : Lint
15- runs-on : ubuntu-latest
16- steps :
17- - uses : actions/checkout@v2
18- with :
19- fetch-depth : 1
20-
21- - uses : actions/setup-node@v2-beta
22- with :
23- node-version : ' ${{ env.NODE_VERSION }}'
24-
25- - name : Get package manager's global cache path
26- id : global-cache-dir-path
27- run : echo "::set-output name=dir::$(yarn cache dir)"
28-
29- - name : Cache package manager's global cache and node_modules
30- id : cache-dependencies
31- uses : actions/cache@v2
32- with :
33- path : |
34- ${{ steps.global-cache-dir-path.outputs.dir }}
35- node_modules
36- key : ${{ runner.os }}-${{ matrix.node-version }}-${{
37- hashFiles('**/yarn.lock'
38- ) }}
39- restore-keys : |
40- ${{ runner.os }}-${{ matrix.node-version }}-
41-
42- - name : Install Dependencies
43- run : yarn install --frozen-lockfile
44- if : |
45- steps.cache-dependencies.outputs.cache-hit != 'true'
46-
47- - name : Lint
48- run : yarn lint
49-
5015 test :
51- name : Tests
52- runs-on : ${{ matrix.os }}
53- needs : lint
54-
55- strategy :
56- matrix :
57- os : [ubuntu-latest]
58- browser : [chrome]
16+ name : " Tests"
17+ runs-on : ubuntu-latest
18+ timeout-minutes : 8
5919
6020 steps :
61- - uses : actions/checkout@v2
62- with :
63- fetch-depth : 1
64-
65- - uses : actions/setup-node@v2-beta
66- with :
67- node-version : ' ${{ env.NODE_VERSION }}'
68-
69- - name : Get package manager's global cache path
70- id : global-cache-dir-path
71- run : echo "::set-output name=dir::$(yarn cache dir)"
72-
73- - name : Cache package manager's global cache and node_modules
74- id : cache-dependencies
75- uses : actions/cache@v2
21+ - name : Checkout
22+ uses : actions/checkout@v3
23+ - name : Use Volta
24+ uses : volta-cli/action@v4
25+ - name : Node Modules Cache
26+ id : cache-npm
27+ uses : actions/cache@v3
7628 with :
7729 path : |
78- ${{ steps.global-cache-dir-path.outputs.dir }}
79- node_modules
80- key : ${{ runner.os }}-${{ matrix.node-version }}-${{
81- hashFiles('**/yarn.lock'
82- ) }}
83- restore-keys : |
84- ${{ runner.os }}-${{ matrix.node-version }}-
85-
30+ .npm
31+ node_modules/
32+ key : ci-npm-${{ hashFiles('package-lock.json') }}
8633 - name : Install Dependencies
87- run : yarn install --frozen-lockfile
88- if : |
89- steps.cache-dependencies.outputs.cache-hit != 'true'
90-
91- - name : Test
92- run : yarn test:ember --launch ${{ matrix.browser }}
93-
94- floating-dependencies :
95- name : Floating Dependencies
96- runs-on : ${{ matrix.os }}
97- needs : lint
34+ if : steps.cache-npm.outputs.cache-hit != 'true'
35+ run : npm ci --cache .npm
36+ - name : Lint
37+ run : npm run lint
38+ - name : Run Tests
39+ run : . bin/restore-env.sh && node_modules/.bin/ember test
9840
99- strategy :
100- matrix :
101- os : [ ubuntu-latest]
102- browser : [chrome]
41+ floating :
42+ name : " Floating Dependencies "
43+ runs-on : ubuntu-latest
44+ timeout-minutes : 8
10345
10446 steps :
105- - uses : actions/checkout@v2
106- with :
107- fetch-depth : 1
108-
109- - uses : actions/setup-node@v2-beta
110- with :
111- node-version : ' ${{ env.NODE_VERSION }}'
112-
113- - name : Get package manager's global cache path
114- id : global-cache-dir-path
115- run : echo "::set-output name=dir::$(yarn cache dir)"
116-
117- - name : Cache package manager's global cache and node_modules
118- id : cache-dependencies
119- uses : actions/cache@v2
120- with :
121- path : |
122- ${{ steps.global-cache-dir-path.outputs.dir }}
123- node_modules
124- key : ${{ runner.os }}-${{ matrix.node-version }}-floating-deps
125- restore-keys : |
126- ${{ runner.os }}-${{ matrix.node-version }}-
127-
47+ - uses : actions/checkout@v3
48+ - name : Use Volta
49+ uses : volta-cli/action@v4
12850 - name : Install Dependencies
129- run : yarn install --no-lockfile --non-interactive
130-
131- - name : Test
132- run : yarn test:ember --launch ${{ matrix.browser }}
51+ run : npm i --cache .npm
52+ - name : Run Tests
53+ run : CI=true node_modules/.bin/ember test
13354
13455 try-scenarios :
135- name : Tests - ${{ matrix.ember- try-scenario }}
56+ name : ${{ matrix.try-scenario }}
13657 runs-on : ubuntu-latest
137- continue-on-error : ${{ matrix.allow-failure }}
138- needs : test
58+ timeout-minutes : 8
13959
14060 strategy :
141- fail-fast : true
61+ fail-fast : false
14262 matrix :
143- ember- try-scenario :
63+ try-scenario :
14464 [
14565 ember-lts-2.12,
14666 ember-lts-2.18,
@@ -154,40 +74,32 @@ jobs:
15474 ember-3.28-with-jquery,
15575 ember-3.28-classic,
15676 ]
157- allow-failure : [false]
15877
15978 steps :
160- - uses : actions/checkout@v2
161- with :
162- fetch-depth : 1
163-
164- - uses : actions/setup-node@v2-beta
165- with :
166- node-version : ' ${{ env.NODE_VERSION }}'
167-
168- - name : Get package manager's global cache path
169- id : global-cache-dir-path
170- run : echo "::set-output name=dir::$(yarn cache dir)"
171-
172- - name : Cache package manager's global cache and node_modules
173- id : cache-dependencies
174- uses : actions/cache@v2
79+ - name : Checkout
80+ uses : actions/checkout@v3
81+ - name : Use Volta
82+ uses : volta-cli/action@v4
83+ - name : Stash package-lock.json for cache key
84+ run : cp package-lock.json __cache-key
85+ - name : Node Modules Cache
86+ id : cache-npm
87+ uses : actions/cache@v3
17588 with :
17689 path : |
177- ${{ steps.global-cache-dir-path.outputs.dir }}
178- node_modules
179- key : ${{ runner.os }}-${{ matrix.node-version }}-${{
180- hashFiles('**/yarn.lock'
181- ) }}
90+ .npm
91+ node_modules/
92+ package.json
93+ package-lock.json
94+ __env
95+ key : ci-npm-v3-${{ matrix.try-scenario }}-${{ hashFiles('config/ember-try.js', '__cache-key') }}
18296 restore-keys : |
183- ${{ runner.os }}-${{ matrix.node-version }}-
184-
97+ ci-npm-${{ hashFiles('package-lock.json') }}
18598 - name : Install Dependencies
186- run : yarn install --frozen-lockfile
187- if : |
188- steps.cache-dependencies.outputs.cache-hit != 'true'
189-
190- - name : Test
191- env :
192- EMBER_TRY_SCENARIO : ${{ matrix.ember-try-scenario }}
193- run : node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
99+ if : steps.cache-npm.outputs.cache-hit != 'true'
100+ run : npm ci --cache .npm
101+ - name : Ember-Try Setup
102+ if : steps.cache-npm.outputs.cache-hit != 'true'
103+ run : node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup --- bin/stash-env.sh
104+ - name : Run Tests
105+ run : . bin/restore-env.sh && CI=true node_modules/.bin/ember test
0 commit comments