Skip to content

Commit 1f6413d

Browse files
authored
Merge pull request #404 from ember-learn/github-ci
simplifying github ci file
2 parents 05d7a0e + 560fade commit 1f6413d

File tree

1 file changed

+46
-72
lines changed

1 file changed

+46
-72
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -4,114 +4,88 @@ on:
44
push:
55
branches:
66
- master
7-
tags:
8-
- v[0-9]+.[0-9]+.[0-9]+
7+
- main
8+
- "v*"
99
pull_request:
1010

1111
env:
1212
NODE_VERSION: 10
1313
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_number }}
1414
PERCY_PARALLEL_TOTAL: 1
15+
FORCE_COLOR: 1
1516

1617
jobs:
1718
lint:
18-
name: Lint and Test
19+
name: Linting
1920
runs-on: ubuntu-latest
20-
timeout-minutes: 3
21-
steps:
22-
- name: Check out a copy of the repo
23-
uses: actions/checkout@v2
24-
25-
- uses: mansona/npm-lockfile-version@v1
2621

27-
- name: Use Node.js ${{ env.NODE_VERSION }}
28-
uses: actions/setup-node@v2-beta
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-node@v2
2925
with:
3026
node-version: ${{ env.NODE_VERSION }}
3127

32-
- name: Cache npm cache and node_modules
33-
id: cache-dependencies
34-
uses: actions/cache@v2
35-
with:
36-
path: |
37-
~/.npm
38-
node_modules
39-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
40-
restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}-
28+
- run: npm i -g npm@7
29+
- run: npm ci
30+
- run: npm run lint
4131

42-
- name: Install dependencies
43-
run: npm install
44-
if: steps.cache-dependencies.outputs.cache-hit != 'true'
45-
46-
- name: Lint
47-
run: npm run lint
32+
floating-dependencies:
33+
name: Floating Dependencies
34+
runs-on: ubuntu-latest
4835

49-
- name: Test
50-
uses: percy/exec-action@v0.3.1
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions/setup-node@v2
5139
with:
52-
custom-command: npm run test:ember
53-
env:
54-
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
55-
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
56-
PERCY_TOKEN: ee0a9d5c1122d6a21852edf19b5b309aaec18077fb3900c98995c90bc48ed240
40+
node-version: ${{ env.NODE_VERSION }}
5741

42+
- run: npm i -g npm@7
43+
- run: npm install --no-package-lock
44+
- run: npm test
5845

59-
test-addon-floating:
60-
name: Test addon (floating dependencies)
46+
test:
47+
name: Tests
6148
runs-on: ubuntu-latest
62-
timeout-minutes: 5
63-
steps:
64-
- name: Check out a copy of the repo
65-
uses: actions/checkout@v2
49+
env:
50+
PERCY_TOKEN: ee0a9d5c1122d6a21852edf19b5b309aaec18077fb3900c98995c90bc48ed240
51+
RUN_PERCY_TESTS: true
52+
6653

67-
- name: Use Node.js ${{ env.NODE_VERSION }}
68-
uses: actions/setup-node@v2-beta
54+
steps:
55+
- uses: actions/checkout@v2
56+
- uses: mansona/npm-lockfile-version@v1
57+
- uses: actions/setup-node@v2
6958
with:
7059
node-version: ${{ env.NODE_VERSION }}
7160

72-
- name: Install dependencies
73-
run: npm install --no-package-lock
74-
75-
- name: Test
76-
run: npm run test:ember
61+
- run: npm i -g npm@7
62+
- run: npm ci
63+
- run: npx percy exec -- npm run test
7764

78-
test-compatibility:
79-
name: Test compatibility
65+
try-scenarios:
66+
name: "ember-try: ${{ matrix.ember-try-scenario }}"
8067
runs-on: ubuntu-latest
68+
timeout-minutes: 10
69+
needs: test
70+
8171
strategy:
82-
fail-fast: true
8372
matrix:
84-
scenario:
73+
ember-try-scenario:
8574
- 'ember-lts-3.16'
8675
- 'ember-lts-3.20'
8776
- 'ember-release'
8877
- 'ember-beta'
8978
- 'ember-canary'
9079
- 'ember-default-with-jquery'
9180
- 'ember-classic'
92-
timeout-minutes: 7
93-
steps:
94-
- name: Check out a copy of the repo
95-
uses: actions/checkout@v2
9681

97-
- name: Use Node.js ${{ env.NODE_VERSION }}
98-
uses: actions/setup-node@v2-beta
82+
steps:
83+
- uses: actions/checkout@v2
84+
- uses: actions/setup-node@v2
9985
with:
10086
node-version: ${{ env.NODE_VERSION }}
10187

102-
- name: Cache npm cache and node_modules
103-
id: cache-dependencies
104-
uses: actions/cache@v2
105-
with:
106-
path: |
107-
~/.npm
108-
node_modules
109-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ matrix.scenario }}-${{ hashFiles('**/package-lock.json') }}
110-
restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ matrix.scenario }}-
111-
112-
- name: Install dependencies
113-
run: npm install
114-
if: steps.cache-dependencies.outputs.cache-hit != 'true'
115-
116-
- name: Test
117-
run: npx ember try:one $EMBER_TRY_SCENARIO ${{ matrix.scenario }}
88+
- run: npm i -g npm@7
89+
- run: npm ci
90+
- name: test
91+
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup

0 commit comments

Comments
 (0)