forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (99 loc) · 2.83 KB
/
ci-master.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
name: Test Master
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.sha }}
- uses: ./.github/actions/build-and-cache
with:
cacheKey: ${{ github.sha }}:build
unit-test:
name: Unit tests
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
testTarget: [backend, frontend, nodes]
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.sha }}
- uses: ./.github/actions/unit-tests
with:
cacheKey: ${{ github.sha }}:build
testTarget: ${{ matrix.testTarget }}
collectCoverage: true
unit-test-node-20:
name: Unit tests (Node 20)
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
testTarget: [backend, frontend, nodes]
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.sha }}
- uses: ./.github/actions/unit-tests
with:
cacheKey: ${{ github.sha }}:build
testTarget: ${{ matrix.testTarget }}
nodeVersion: 20.x
lint:
name: Lint
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
lintTarget: [backend, frontend, nodes]
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.sha }}
- uses: ./.github/actions/lint
with:
cacheKey: ${{ github.sha }}:build
lintTarget: ${{ matrix.lintTarget }}
notify-on-failure:
name: Notify Slack on failure
runs-on: ubuntu-latest
needs: [unit-test, unit-test-node-20, lint]
steps:
- name: Notify Slack on failure
uses: act10ns/[email protected]
if: failure()
with:
status: ${{ job.status }}
channel: '#alerts-build'
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
message: Master branch (build or test or lint) failed (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
upload-coverage:
name: Upload Coverage
runs-on: ubuntu-latest
needs: unit-test
steps:
- uses: actions/cache/[email protected]
with:
path: ./packages/**/coverage
key: ${{ github.sha }}:build:backend:coverage
- uses: actions/cache/[email protected]
with:
path: ./packages/**/coverage
key: ${{ github.sha }}:build:frontend:coverage
- uses: actions/cache/[email protected]
with:
path: ./packages/**/coverage
key: ${{ github.sha }}:build:nodes:coverage
- run: ls -R packages
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
files: packages/**/coverage/cobertura-coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}