-
-
Notifications
You must be signed in to change notification settings - Fork 22
194 lines (167 loc) · 5.45 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
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
##############################################################
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
env:
codemirror: packages/codemirror/
consts: packages/consts/
horizon: packages/horizon-theme/
monaco: packages/monaco
sw: packages/transpilation/
NODE_OPTIONS: "--max-old-space-size=4096 --trace-warnings --unhandled-rejections=strict"
TURBO_API: http://127.0.0.1:9080
TURBO_TOKEN: this-is-not-a-secret
TURBO_TEAM: myself
permissions:
contents: read
##############################################################
jobs:
##############################################################
install_dependencies:
name: Setup
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: echo ${{ github.event.number }} > ./pr-number.txt
- run: pnpm turbo build
# Used for faster deploy so we don't need to checkout the repo
- uses: actions/upload-artifact@v4
with:
name: deploy-prep-dist
if-no-files-found: error
path: |
./apps/**/dist/**/*
!node_modules/
!./**/node_modules/
##############################################################
lints:
name: "Lints"
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [install_dependencies]
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm lint
##############################################################
tests_node:
name: "Node Tests"
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [install_dependencies]
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: pnpm turbo test:node
tests:
name: "Ember Tests"
strategy:
matrix:
# os: [ubuntu-latest, macOS-latest, windows-latest]
# browsers: [chrome, firefox, safari, edge]
ci_browser:
- Chrome
- Firefox
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [install_dependencies]
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Environment Info
run: |
firefox --version
google-chrome --version
echo "Node: $( node --version )"
echo "NPM: $( npm --version )"
echo "pnpm: $( pnpm --version )"
- name: Test
run: pnpm turbo test:ember
env:
CI_BROWSER: ${{ matrix.ci_browser }}
# try-scenarios:
# name: "Test try-scenarios"
# runs-on: ubuntu-latest
# timeout-minutes: 15
# needs: [tests]
# # I need to figure out a better way to handle this with turbo
# continue-on-error: true
# steps:
# - uses: actions/checkout@v3
# - name: TurboRepo local server
# uses: felixmosh/turborepo-gh-artifacts@v2
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - uses: NullVoxPopuli/[email protected]
# - name: Test
# run: pnpm turbo test:scenarios
browserstack-test:
name: Browserstack Tests (Safari, Edge, etc)
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [tests]
steps:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm turbo test:browserstack --log-order stream --output-logs=new-only
env:
# This is a guest user on an open source plan.
# (limited access, etc etc)
#
# Exposing this key is the only way to reasonably
# have browserstack run on PRs from forks
BROWSERSTACK_ACCESS_KEY: km7yCVefUQDSdFMF9o64
BROWSERSTACK_USERNAME: glimdown_6vzpNh
##############################################################
##############################################################
#
# These jobs won't run on pull requests.
# They would fail anyway because secrets are not exposed.
#
##############################################################
##############################################################
# NOTE: this is basically the same code as in DeployPreview
DeployProduction:
name: "Deploy: Production ${{ matrix.app.name }}"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [browserstack-test]
strategy:
matrix:
app:
- { path: "./tutorial/dist", cloudflareName: "limber-glimmer-tutorial", name: "tutorial" }
- { path: "./repl/dist", cloudflareName: "limber-glimdown", name: "limber" }
permissions:
contents: read
deployments: write
outputs:
limberUrl: ${{ steps.limber.outputs.url }}
tutorialUrl: ${{ steps.tutorial.outputs.url }}
steps:
- uses: actions/download-artifact@v4
name: deploy-prep-dist
- name: Publish ${{ matrix.app.name }}
working-directory: ./deploy-prep-dist/${{ matrix.app.path }}
run: |
npx wrangler pages deploy ./ \
--project-name=${{ matrix.app.cloudflareName }} \
--branch=${{ github.event.workflow_run.head_branch }} \
--commit-hash=${{ github.event.workflow_run.head_sha }}
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}