-
Notifications
You must be signed in to change notification settings - Fork 18
138 lines (133 loc) · 4.97 KB
/
build-and-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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: CI-build-and-test
on:
push
jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
java: [ "21" ]
env:
IS_NOOP: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release-') }}
steps:
- name: Inform on no-op
run: echo "Running this as a no-op job... ${{ env.IS_NOOP}}"
- name: Run preparatory steps
if: ${{ env.IS_NOOP == 'false' }}
uses: dasch-swiss/dsp-api/.github/actions/preparation@main
with:
java-version: ${{ matrix.java }}
- name: Run all tests
if: ${{ env.IS_NOOP == 'false' }}
run: ./sbtx -v coverage "webapi/test" coverageAggregate
- name: WebApi Unit Test Report
uses: dorny/test-reporter@v1
if: ${{ env.IS_NOOP == 'false' && (success() || failure()) }}
with:
name: WebApi Unit Test Results
path: ./webapi/target/test-reports/TEST-*.xml
reporter: java-junit
- name: Upload coverage data to codacy
if: ${{ env.IS_NOOP == 'false' }}
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./target/scala-3.3.4/coverage-report/cobertura.xml
- name: Upload coverage data to codecov
if: ${{ env.IS_NOOP == 'false' }}
uses: codecov/codecov-action@v3
with:
files: ./target/scala-3.3.4/coverage-report/cobertura.xml
- name: No-op step
if: ${{ env.IS_NOOP == 'true' }}
run: echo "No checks on main or release branches, skipping this job."
integration-test:
name: Build and integration-test
runs-on: buildjet-4vcpu-ubuntu-2204
strategy:
matrix:
java: [ "21" ]
concurrency:
group: ${{ github.ref }}-${{ matrix.java }}-it
cancel-in-progress: true
env:
IS_NOOP: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release-') }}
steps:
- name: Inform on no-op
run: echo "Running this as a no-op job... ${{ env.IS_NOOP}}"
- name: Run preparatory steps
if: ${{ env.IS_NOOP == 'false' }}
uses: dasch-swiss/dsp-api/.github/actions/preparation@main
with:
java-version: ${{ matrix.java }}
- name: Run all integration tests
if: ${{ env.IS_NOOP == 'false' }}
run: make integration-test
- name: WebApi Integration Test Report
uses: dorny/test-reporter@v1
if: ${{ env.IS_NOOP == 'false' && (success() || failure()) }}
with:
name: WebApi Integration Test Results
path: ./integration/target/test-reports/TEST-*.xml
reporter: java-junit
- name: Upload coverage data to codacy
if: ${{ env.IS_NOOP == 'false' }}
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./target/scala-3.3.4/coverage-report/cobertura.xml
- name: Upload coverage data to codecov
if: ${{ env.IS_NOOP == 'false' }}
uses: codecov/codecov-action@v3
with:
files: ./target/scala-3.3.4/coverage-report/cobertura.xml
- name: No-op step
if: ${{ env.IS_NOOP == 'true' }}
run: echo "No checks on main or release branches, skipping this job."
test-docs-build:
name: Test docs
runs-on: ubuntu-latest
env:
IS_NOOP: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release-') }}
steps:
- name: Inform on no-op
run: echo "Running this as a no-op job... ${{ env.IS_NOOP}}"
- name: Checkout source
if: ${{ env.IS_NOOP == 'false' }}
uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- name: Install requirements (pip, npm, apt)
if: ${{ env.IS_NOOP == 'false' }}
run: |
just docs-install-requirements
npm install --global typedoc
sudo apt-get install graphviz
- name: markdownlint
if: ${{ env.IS_NOOP == 'false' }}
run: just markdownlint
- name: Build docs
if: ${{ env.IS_NOOP == 'false' }}
run: just docs-build
- name: No-op step
if: ${{ env.IS_NOOP == 'true' }}
run: echo "No checks on main or release branches, skipping this job."
check-formatting:
name: Check formatting
runs-on: ubuntu-latest
env:
IS_NOOP: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release-') }}
steps:
- name: Inform on no-op
run: echo "Running this as a no-op job... ${{ env.IS_NOOP}}"
- name: Run preparatory steps
if: ${{ env.IS_NOOP == 'false' }}
uses: dasch-swiss/dsp-api/.github/actions/preparation@main
with:
java-version: 21
- name: Check formatting
if: ${{ env.IS_NOOP == 'false' }}
run: make check
- name: No-op step
if: ${{ env.IS_NOOP == 'true' }}
run: echo "No checks on main or release-please branches, skipping this job."