This repository has been archived by the owner on Nov 24, 2022. It is now read-only.
59 lines (56 loc) 路 2.29 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
# This workflow runs some tests to make sure everything's fine before introducing bad code or a bug into the production website
name: Continuous Integration
on: push
# Cancel previous instances of this workflow
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
name: Lint # This "lints" our entire project, making sure the code is correct, conforms to our style and isn't poorly written
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Setup
uses: actions/setup-node@v3.5.0
with:
node-version: 16 # Use the latest LTS release
cache: npm
- name: Install
uses: nick-fields/retry@v2.8.1 # Retry npm installation when an http download fails (often due to rate limiting)
with:
timeout_minutes: 5
max_attempts: 3
command: npm ci # Installs dependencies without modifying lockfile (for production installs)
retry_wait_seconds: 60
- name: Run Linters
run: npm run lint
env:
ci: true
NODE_ENV: production
typecheck:
name: Type Checking # TypeScript checks the static typings in our code
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Setup
uses: actions/setup-node@v3.5.0
with:
node-version: 16 # Use the latest LTS release
cache: npm
- name: Install
uses: nick-fields/retry@v2.8.1 # Retry npm installation when an http download fails (often due to rate limiting)
with:
timeout_minutes: 5
max_attempts: 3
command: npm ci # Installs dependencies without modifying lockfile (for production installs)
retry_wait_seconds: 60
- name: Run TypeScript
run: npm run check
env:
ci: true
NODE_ENV: production