-
Notifications
You must be signed in to change notification settings - Fork 5
172 lines (148 loc) · 5.4 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
name: The Trial of Truth aka CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
permissions:
contents: read
jobs:
files-changed:
if: github.event.pull_request.draft == false
name: The Scrutiny of Change
runs-on: ubuntu-latest
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
outputs:
api_source: ${{ steps.changes.outputs.api_source }}
client_source: ${{ steps.changes.outputs.client_source }}
workflows: ${{ steps.changes.outputs.workflows }}
steps:
- name: Unveiling the Repository
uses: actions/checkout@v4
- name: The Chronicle of Alterations
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
api_source:
- 'projects/api/src/**'
- 'projects/api/deno.json'
client_source:
- 'projects/client/src/**'
- 'projects/client/i18n/**'
- 'projects/client/static/**'
- 'projects/client/package.json'
- 'projects/client/deno.json'
- 'projects/client/svelte.config.js'
- 'projects/client/vite.config.ts'
- 'projects/client/wrangler.toml'
workflows:
- '.github/workflows/**'
test:
needs: files-changed
if: ${{
needs.files-changed.outputs.api_source == 'true' ||
needs.files-changed.outputs.client_source == 'true' ||
needs.files-changed.outputs.workflows == 'true'
}}
name: The Interrogation Room (Test)
runs-on: ubuntu-latest
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Secure the Evidence aka Checkout Code
uses: actions/checkout@v4
- name: Summon the Digital Oracle aka Install Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Gather the Tools aka Install Dependencies
run: 'deno task install'
- name: Probe the Client's Mind aka Run Tests
working-directory: projects/client
run: 'deno task test:cov'
- name: Consulting the Oracles of Type aka Type Check
working-directory: projects/client
run: 'deno task check'
- name: Probing the API's Mind aka Run Tests
working-directory: projects/api
run: 'deno task test'
- name: The Phantom Browsers Materialize aka Install Browsers
working-directory: projects/client
run: 'deno run -A npm:@playwright/test install chromium'
- name: Whispers of the Future aka Preview Build
working-directory: projects/client
run: 'deno task build:preview'
env:
TRAKT_CLIENT_ID: ${{ secrets.TRAKT_CLIENT_ID }}
- name: Witnessing the Premonition ake Run Preview
working-directory: projects/client
run: |
deno task preview &
echo $! > server.pid
env:
TRAKT_CLIENT_ID: ${{ secrets.TRAKT_CLIENT_ID }}
TRAKT_CLIENT_SECRET: ${{ secrets.TRAKT_CLIENT_SECRET }}
TRAKT_SESSION_SECRET: ${{ secrets.TRAKT_SESSION_SECRET }}
- name: The Verdict on the Interface aka E2E Tests
working-directory: projects/client
run: 'deno task test:e2e'
env:
E2E_HEADLESS: 'true'
E2E_BASE_URL: 'http://localhost:4173/'
- name: Witnessing the Premonition's Demise aka Kill Preview
working-directory: projects/client
run: kill $(cat server.pid)
- name: Trial by Code Climate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
prefix: ${{github.workspace}}
coverageLocations: |
${{github.workspace}}/projects/client/coverage/clover.xml:clover
- name: Trial by Deep Source
uses: deepsourcelabs/test-coverage-action@master
with:
key: javascript
coverage-file: ${{github.workspace}}/projects/client/coverage/lcov.info
dsn: ${{ secrets.DEEPSOURCE_DSN }}
build:
name: The Forge (Build)
runs-on: ubuntu-latest
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
needs: test
steps:
- name: Secure the Evidence aka Checkout Code
uses: actions/checkout@v4
- name: Summon the Digital Oracle aka Install Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Gather the Tools aka Install Dependencies
run: 'deno task install'
- name: Weaving the Digital Tapestry aka Build
working-directory: projects/client
run: 'deno task build'
env:
TRAKT_CLIENT_ID: ${{ secrets.TRAKT_CLIENT_ID }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
FIREBASE_MEASUREMENT_ID: ${{ secrets.FIREBASE_MEASUREMENT_ID }}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
- name: Delivering the Goods aka Upload Build
if: github.ref == 'refs/heads/main'
uses: ./.github/actions/upload-output
with:
buildArtifact: pandoras-archive
cloudflareArtifact: the-edge-awakened
wranglerArtifact: the-edge-config