-
-
Notifications
You must be signed in to change notification settings - Fork 3
171 lines (162 loc) · 5.16 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
name: CI
on:
push:
branches:
- main
- develop
- beta
# npm version tags
- /^v\d+.\d+.\d+(?:-(?:alpha|beta|rc)\.\d+)?/
pull_request:
concurrency:
group: ci-tests-${{ github.ref }}-1
cancel-in-progress: true
env:
CI: true
dist: ember-stereo/dist
jobs:
install_dependencies:
name: Install Dependencies
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
lint:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: Lint
needs: [install_dependencies]
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
path:
- ./ember-stereo
- ./test-app
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: ESLint
run: cd ${{ matrix.path }} && pnpm run lint:js
- name: Template Lint
run: cd ${{ matrix.path }} && pnpm run lint:hbs
build:
name: Build Tests
needs: [install_dependencies]
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- uses: ./.github/actions/assert-build
default-tests:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: Default Tests
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- uses: ./.github/actions/download-built-package
- run: pnpm --filter test-app test:ember
floating-dependencies:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: Floating Deps Test
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Install Dependencies (without lockfile)
run: rm pnpm-lock.yaml && pnpm install
- uses: ./.github/actions/download-built-package
- run: pnpm --filter test-app test:ember
ember-try-required:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: Tests - ${{ matrix.ember-try-scenario }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allow-failure }}
needs:
- build
- lint
strategy:
fail-fast: false
max-parallel: 1
matrix:
ember-try-scenario:
- ember-lts-4.8
- ember-4.12
- embroider-safe
- embroider-optimized
allow-failure: [false]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- uses: ./.github/actions/download-built-package
- name: Run Tests
working-directory: ./test-app
run: |
if [[ "${{matrix.ember-try-scenario}}" == "'ember-lts-4.8 + embroider-optimized'" ]]; then
echo 'Running custom try scenario due to peer deps resolving incorrectly (due to installation issues)'
pnpm add --save-dev ember-source@~4.8.0
pnpm add --save-dev @embroider/core @embroider/webpack @embroider/compat
pnpm test:ember
else
pnpm test:ember-try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
fi
ember-try-optional:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: Tests - ${{ matrix.ember-try-scenario }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allow-failure }}
needs: [build, lint]
strategy:
fail-fast: true
max-parallel: 1
matrix:
allow-failure: [true]
ember-try-scenario:
- ember-release
- ember-beta
- ember-canary
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- uses: ./.github/actions/download-built-package
- name: Run Tests
working-directory: ./test-app
run: |
if [[ "${{matrix.ember-try-scenario}}" == "'ember-lts-4.8 + embroider-optimized'" ]]; then
echo 'Running custom try scenario due to peer deps resolving incorrectly (due to installation issues)'
pnpm add --save-dev ember-source@~4.8.0
pnpm add --save-dev @embroider/core @embroider/webpack @embroider/compat
pnpm test:ember
else
pnpm test:ember-try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
fi
deploy:
name: Deploy
runs-on: ubuntu-latest
if: contains('refs/heads/main', github.ref) || contains('refs/heads/beta', github.ref)
needs: [default-tests, floating-dependencies, ember-try-required]
steps:
- name: Dispatch Release
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Deploy Docs
token: ${{ secrets.GH_TOKEN }}
publish:
name: Release
runs-on: ubuntu-latest
if: contains('refs/heads/main', github.ref) || contains('refs/heads/beta', github.ref)
needs: [default-tests, floating-dependencies, ember-try-required]
steps:
- name: Dispatch Release
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Generate New Release
token: ${{ secrets.GH_TOKEN }}