-
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (72 loc) · 1.91 KB
/
checks.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
name: Checks
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.branch }}
jobs:
build:
name: Build client
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- name: Build client
run: npm run build
commitlint:
name: CommitLint
if: ${{ contains(github.event_name, 'pull_request') }}
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- name: Lint pull request title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "$PR_TITLE" | npx commitlint
e2e:
name: End-to-end tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker build
run: docker build -t narf:latest .
- name: Cypress
run: |
mkdir db
docker run -d -p 3000:3000 -v $(pwd)/db:/app/db narf:latest
npm i cypress
npm run e2e
eslint:
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- name: ESLint
run: npx eslint .
prettier:
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- name: Prettier
run: npx prettier -l -u .
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: haliphax/narf/.github@main
- uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Run unit tests
run: npm run coverage
- name: Upload coverage report or add comment
uses: coverallsapp/github-action@v2
if: always()
with:
file: coverage/clover.xml
- name: Push result to Testspace server
run: testspace ./coverage/clover.xml ./coverage/junit.xml
if: always()