-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (150 loc) · 4.45 KB
/
main.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
name: CI
on: push
jobs:
format-lint:
name: Format and Lint
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run `astro check`
run: pnpm run check
- name: Run Prettier
run: pnpm run format:fix
- name: Run ESLint with fix options
run: pnpm run lint:fix
- name: Commit files modified by ESLint
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply Format and Lint changes
lint-text:
name: Textlint
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run Textlint
run: pnpm run lint:text
test-type:
name: Typecheck
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build app
run: pnpm run build
- name: Run Vitest typecheck
run: pnpm run test:type
test-unit:
name: Unit Test
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run Vitest
run: pnpm run test:unit
test-e2e:
name: E2E Test
timeout-minutes: 60
runs-on: ubuntu-22.04
strategy:
matrix:
browser:
- chromium
- firefox
- webkit
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Store Playwright's version
run: |
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test | grep @playwright | awk '{ print $2 }')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright browsers for Playwright's version
id: cache-playwright
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-${{ matrix.browser }}
- name: Setup Playwright
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps ${{ matrix.browser }}
- name: Install Additional Dependencies
if: steps.cache-playwright.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps ${{ matrix.browser }}
- name: Build app
run: pnpm run build
- name: Run Playwright tests
run: pnpm exec playwright test --project=${{ matrix.browser }}
coverage:
name: Coverage
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Generate coverage file
run: pnpm run coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/coverage-final.json