-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (83 loc) · 2.42 KB
/
test.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
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
env:
NODE_VERSION: '22'
jobs:
tests_cov:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm ci
run: npm ci --prefer-offline --no-audit
- name: Start UP MinIO
uses: infleet/[email protected]
with:
port: "9000"
version: "latest"
username: "miniouser"
password: "miniouser"
- name: test:cov - test all with coverage
timeout-minutes: 15
run: export RUN_WITHOUT_JEST_COVERAGE='true' && export NODE_OPTIONS='--max_old_space_size=4096' && ./node_modules/.bin/jest --shard=${{ matrix.shard }}/${{ strategy.job-total }} --coverage --force-exit
- name: save-coverage
run: mv coverage/lcov.info coverage/${{matrix.shard}}.info
- name: "upload-artifacts"
uses: actions/upload-artifact@v4
with:
name: coverage-artifacts-${{ matrix.shard }}
path: coverage/
sonarcloud:
name: SonarCloud coverage
runs-on: ubuntu-latest
needs: [tests_cov]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
pattern: coverage-artifacts-*
path: coverage
merge-multiple: true
- name: Merge Code Coverage
run: |
sudo apt-get install -y lcov
find coverage -name *.info -exec echo -a {} \; | xargs lcov -o merged-lcov.info
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: SonarCloud upload coverage
uses: SonarSource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
lint:
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- name: checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm ci
run: npm ci --prefer-offline --no-audit
- name: lint
run: npm run lint