-
-
Notifications
You must be signed in to change notification settings - Fork 18
75 lines (72 loc) · 2.34 KB
/
Copy pathfrontend-checks.yml
File metadata and controls
75 lines (72 loc) · 2.34 KB
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
---
name: Frontend Checks
# GHA requires bare `on:` which yamllint sees as boolean
# yamllint disable-line rule:truthy
on:
workflow_call:
jobs:
lint-and-build:
# pre-commit.ci skips yarn-lint and yarn-build (Node.js not available), so CI needs this job
name: Yarn Lint and Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 2
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: lts/jod
- name: Install dependencies
run: yarn install
- name: Lint
run: yarn lint:fix
- name: Check for changes from lint
id: change_lint
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Check if clean from lint
if: steps.change_lint.outputs.changed != 0
uses: actions/github-script@v9
with:
script: |
core.setFailed('Repo is dirty after lint! Run yarn lint:fix locally before pushing changes.')
- name: Build
run: yarn build
- name: Check for changes from build
id: change_build
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Check if clean from build
if: steps.change_build.outputs.changed != 0
uses: actions/github-script@v9
with:
script: |
core.setFailed('Repo is dirty after build! Run yarn build locally before pushing changes.')
vitest:
name: Vitest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: lts/jod
- name: Install dependencies
run: yarn install
- name: Run tests
run: >-
yarn test --coverage --coverage.reporter=json
--reporter=default --reporter=junit
--outputFile.junit=junit.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: typescript
files: ./coverage/coverage-final.json
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: typescript
files: junit.xml