-
-
Notifications
You must be signed in to change notification settings - Fork 392
127 lines (105 loc) · 3.02 KB
/
quality.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
name: Quality
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
env:
FORCE_COLOR: 3
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
jobs:
prettier:
name: Prettier
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./tooling/github-actions/install
- name: Run Prettier
run: turbo format --continue
eslint:
name: ESLint
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup and install
uses: ./tooling/github-actions/install
- name: Lint
run: turbo lint --continue
typecheck:
name: TypeCheck
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./tooling/github-actions/install
- name: Cache TypeScript TSBuild Info Files
id: cache-typescript-tsbuildinfo
uses: actions/cache@v3
with:
path: node_modules/.cache/*-tsbuildinfo.json
# We use the commit hash as the key to always update the cache as a
# workaround to this issue:
# https://github.com/actions/cache/issues/106
key: ${{ runner.os }}-cache-typescript-tsbuildinfo-${{ github.sha }}
restore-keys: ${{ runner.os }}-cache-typescript-tsbuildinfo-
- name: Run TypeScript type check
run: turbo typecheck --continue
e2e:
name: E2E
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./tooling/github-actions/install
- name: Install Playwright Browsers
run: pnpm exec playwright install chromium --with-deps
- name: Setup database
run: |
cp .env.example .env
docker compose up -d --wait
pnpm db:push
pnpm db:seed
- name: Build
run: turbo build
env:
GITHUB_ID: ' '
GITHUB_SECRET: ' '
- name: Run Playwright tests
run: turbo test:e2e --continue
env:
DATABASE_URL: mysql://dev:dev@localhost/typehero
GITHUB_ID: ' '
GITHUB_SECRET: ' '
NEXTAUTH_SECRET: 'kGvjABB9ZZsxhYFyxMT4ApohaIvfuNSRMIthI+usjA0='
NEXTAUTH_URL: http://localhost:3000
- name: Upload report
if: always()
uses: actions/upload-artifact@v3
with:
name: report
path: apps/web/playwright-report/
- name: Save PR number
if: always()
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > prNumber
- name: Upload prNumber
if: always()
uses: actions/upload-artifact@v3
with:
name: prNumber
path: prNumber