-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (53 loc) · 1.54 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
name: CI
on:
push:
branches:
- dev
pull_request:
workflow_dispatch:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
permissions:
actions: read
contents: read
env:
HUSKY: 0
jobs:
test-and-lint:
name: Test and Lint
runs-on:
- frontend
- self-hosted
if: (github.event_name == 'pull_request' && !github.event.pull_request.draft) || (github.event_name == 'push' && github.ref == 'refs/heads/dev')
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- name: Setup dependencies
run: |
pnpm install --frozen-lockfile
pnpm cypress install --force
- uses: nrwl/nx-set-shas@v4
# - name: Run lint for affected projects
# run: pnpm exec nx affected --target lint
# - name: Run tests for affected projects
# run: pnpm exec nx affected --target test --ci --coverage
# - name: Run build for affected projects
# run: pnpm exec nx affected --target build
- name: Run lint test and build
run: pnpm exec nx run-many --target lint test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}