-
Notifications
You must be signed in to change notification settings - Fork 11
86 lines (71 loc) · 2.54 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
env:
is-master-branch: ${{ github.ref == 'refs/heads/master' }}
is-next-branch: ${{ github.ref == 'refs/heads/next' }}
is-pull-request: ${{ github.event_name == 'pull_request' }}
on:
push:
branches:
- master
- next
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm run ci:install
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: "master"
- run: npm run report
- run: npm run format:check
- name: Merge - Lint all projects
if: ${{ env.is-master-branch == 'true' || env.is-next-branch == 'true' }}
run: npm run ci:lint
- name: PR - Lint affected
if: ${{ env.is-pull-request == 'true' }}
run: npm run affected:lint
- name: Merge - Build all projects
if: ${{ env.is-master-branch == 'true' || env.is-next-branch == 'true' }}
run: npm run ci:build
- name: PR - Build affected
if: ${{ env.is-pull-request == 'true' }}
run: npm run affected:build
- name: Merge - Test all projects
if: ${{ env.is-master-branch == 'true' || env.is-next-branch == 'true' }}
run: npm run ci:test
- name: PR - Test affected
if: ${{ env.is-pull-request == 'true' }}
run: npm run affected:test
- name: Publish Linting Report
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
with:
report_paths: "**/reports/lint/**/*.xml"
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: "**/reports/unit/**/*.xml"
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=tuwien-csd
-Dsonar.projectKey=tuwien-csd_damap-frontend
-Dsonar.sources=.
-Dsonar.sourceEncoding=UTF-8
-Dsonar.javascript.lcov.reportPaths=**/lcov.info
-Dsonar.coverage.exclusions=**/*.spec.ts,**/karma.conf.js,src/environments/*.ts,src/main.ts,src/test.ts,apps/damap-frontend-e2e/**/*.*