-
Notifications
You must be signed in to change notification settings - Fork 17
90 lines (87 loc) · 3.89 KB
/
pull_request.yml
File metadata and controls
90 lines (87 loc) · 3.89 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install Dependencies
run: npm ci
- name: Run Linter
run: npm run lint
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
test: [unit, integration:v5:batch]
batch-index: [0, 1, 2, 3, 4]
exclude:
- test: unit
batch-index: 1
- test: unit
batch-index: 2
- test: unit
batch-index: 3
- test: unit
batch-index: 4
- test: integration:v4
batch-index: 1
- test: integration:v4
batch-index: 2
- test: integration:v4
batch-index: 3
- test: integration:v4
batch-index: 4
name: Node.js v${{ matrix.node-version }} - ${{ matrix.test == 'integration:v5:batch' && format('{0}{1}', matrix.test, matrix.batch-index) || matrix.test }} tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm ci
- name: Run ${{ matrix.test }} Tests and Add Annotations
id: tests
run: |
if [ "${{ matrix.test }}" = "integration:v5:batch" ]; then
npm run test:integration:v5:batch -- ${{ matrix.batch-index }} -- --ci --coverage --reporters=default --reporters=github-actions --reporters=jest-junit
else
npm run test:${{ matrix.test }} -- --ci --coverage --reporters=default --reporters=github-actions --reporters=jest-junit
fi
env:
ORKES_BACKEND_VERSION: ${{ matrix.test == 'integration:v4' && '4' || (contains(matrix.test, 'integration:v5') && '5' || '') }}
CONDUCTOR_SERVER_URL: ${{ matrix.test == 'integration:v4' && vars.SERVER_URL_V4 || (contains(matrix.test, 'integration') && vars.SERVER_URL || '') }}
CONDUCTOR_AUTH_KEY: ${{ matrix.test == 'integration:v4' && secrets.AUTH_KEY_V4 || (contains(matrix.test, 'integration') && secrets.AUTH_KEY || '') }}
CONDUCTOR_AUTH_SECRET: ${{ matrix.test == 'integration:v4' && secrets.AUTH_SECRET_V4 || (contains(matrix.test, 'integration') && secrets.AUTH_SECRET || '') }}
CONDUCTOR_SDK_INITIAL_TOKEN_STAGGER_MS: ${{ (matrix.test == 'integration:v4' || contains(matrix.test, 'integration')) && '2000' || '' }}
JEST_JUNIT_OUTPUT_NAME: ${{ matrix.test == 'integration:v5:batch' && format('{0}{1}-node-{2}-test-results.xml', matrix.test, matrix.batch-index, matrix.node-version) || format('{0}-node-{1}-test-results.xml', matrix.test, matrix.node-version) }}
- name: Publish Test Results
uses: dorny/test-reporter@v2
if: ${{ !cancelled() }}
with:
name: ${{ matrix.test == 'integration:v5:batch' && format('{0}{1} (Node {2})', matrix.test, matrix.batch-index, matrix.node-version) || format('{0} (Node {1})', matrix.test, matrix.node-version) }}
path: reports/${{ matrix.test == 'integration:v5:batch' && format('{0}{1}-node-{2}-test-results.xml', matrix.test, matrix.batch-index, matrix.node-version) || format('{0}-node-{1}-test-results.xml', matrix.test, matrix.node-version) }}
reporter: jest-junit
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: ${{ matrix.test }}
name: codecov-${{ matrix.test }}-node-${{ matrix.node-version }}
fail_ci_if_error: false