-
Notifications
You must be signed in to change notification settings - Fork 7
197 lines (175 loc) · 5.36 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: CI
on:
push:
branches:
- main
- master
pull_request: {}
workflow_dispatch: {}
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
TURBO_API: http://127.0.0.1:9080
TURBO_TOKEN: this-is-not-a-secret
TURBO_TEAM: myself
jobs:
setup:
name: 'Setup'
runs-on: ubuntu-latest
outputs:
pending: ${{ steps.set-pending.outputs.pend }}
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm build
# This is insufficient / would be very verbose
# need to create a tool that knows what all the scenarios are,
# and iterates over them to create JSON
- id: tasks
run: |
function isPendingTask() {
local taskName=$1
local packageName=$2
local result=$( \
pnpm turbo run --summarize --dry-run json $taskName \
| jq '.tasks[] | select(.package == "$packageName")' \
| jq '.cache.status' \
)
if [ "$result" == "MISS" ]; then
true
else
false
fi
}
# echo "try.classic=$(isPendingTask 'test:scenario' 'test-app')"
# TODO: pre-configure all the tasks that need running:
#
# pnpm turbo run --summarize --dry-run json $TASK_NAME\
# | jq '.tasks[] | select(.package == "$PACKAGE_NAME")' \
# | jq '.cache.status'
#
# (Don't forget to include ENV variables specified in turbo.json)
# debug_pending_tasks:
# runs-on: ubuntu-latest
# needs: [setup]
# steps:
# - run: echo ${{ needs.setup.outputs.pending }}
# - run: echo '${{ needs.setup.outputs.pending }}' | jq
# - run: echo '${{ fromJSON(needs.setup.outputs.pending).atAll.lint }}'
lint:
name: Lint
runs-on: ubuntu-latest
needs: [setup]
# if: ${{ fromJSON(needs.setup.outputs.pending).atAll.lint }}
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm lint
test:
name: "Default Tests"
runs-on: ubuntu-latest
needs: [setup]
# if: ${{ fromJSON(needs.setup.outputs.pending).atAll.test }}
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm turbo test:ember --filter test-app
floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest
needs: [test]
# if: ${{ fromJSON(needs.setup.outputs.pending).atAll.test }}
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pnpm-args: --no-lockfile
- run: pnpm turbo test:ember --filter test-app
try-scenarios:
name: "${{ matrix.try-scenario }} ${{ matrix.test-app == 'test-app' && '(Classic)' || '(Embroider)' }}"
runs-on: ubuntu-latest
needs: [test]
# if: ${{ fromJSON(needs.setup.outputs.pending).atAll.test }}
strategy:
fail-fast: false
matrix:
allow-failure: [false]
try-scenario:
- ember-resources-5.3
- ember-resources-7
- ember-lts-3.28
- ember-lts-4.4
# - ember-lts-4.8
# - ember-data @ 4.8 has incorrect peers, so we can't test it
- ember-lts-4.12
- ember-5.0
- ember-lts-5.4
- ember-release
- ember-beta
- ember-canary
test-app:
- test-app
- test-embroider-app
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tests
run: pnpm turbo test:scenario --filter ${{ matrix.test-app }} --log-prefix none -- --skip-cleanup
env:
SCENARIO: ${{ matrix.try-scenario }}
typecheck_v4:
name: '4.* ${{ matrix.typescript-scenario }}'
runs-on: ubuntu-latest
# if: ${{ fromJSON(needs.setup.outputs.pending).atAll.typecheck }}
timeout-minutes: 2
needs: [test]
continue-on-error: true
strategy:
fail-fast: true
matrix:
typescript-scenario:
- typescript@4.8
- typescript@4.9
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Change TS to ${{ matrix.typescript-scenario }}'
run: |
pnpm add --save-dev ${{ matrix.typescript-scenario}}
pnpm remove @tsconfig/ember
pnpm add @tsconfig/ember@^2.0.0
working-directory: ./test-app
- name: 'Type checking'
run: pnpm turbo --filter 'test-app' lint:types
typecheck_v5:
name: '5.* ${{ matrix.typescript-scenario }}'
runs-on: ubuntu-latest
# if: ${{ fromJSON(needs.setup.outputs.pending).atAll.typecheck }}
timeout-minutes: 2
needs: [test]
continue-on-error: true
strategy:
fail-fast: true
matrix:
typescript-scenario:
- typescript@5.0
- typescript@5.1
- typescript@5.2
- typescript@5.3
- typescript@rc
- typescript@next
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Change TS to ${{ matrix.typescript-scenario }}'
run: 'pnpm add --save-dev ${{ matrix.typescript-scenario}}'
working-directory: ./test-app
- name: 'Type checking'
run: pnpm turbo --filter 'test-app' lint:types