-
Notifications
You must be signed in to change notification settings - Fork 39
117 lines (114 loc) · 3.87 KB
/
build.yaml
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
name: Build and test
on:
push:
branches: [master]
pull_request:
branches: [master]
paths-ignore:
- '**/*.md'
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
checks: write
security-events: write
jobs:
build-and-test:
if: always()
strategy:
matrix:
java: [ '17', '20' ]
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Run build and unit tests
run: mvn -T1C --no-transfer-progress --color=always -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -am -pl nflow-jetty,nflow-netty,nflow-metrics test
- name: Publish JUnit test report
uses: scacap/action-surefire-report@v1
if: always()
with:
check_name: 'Unit Test Report for Java ${{ matrix.java }}'
build-and-test-nflow-explorer:
if: always()
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Run build and unit tests
run: mvn -T1C --no-transfer-progress --color=always -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -am -pl nflow-explorer test
javadoc-spotbugs-codeql:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: java, javascript
config-file: ./.github/codeql-config.yaml
- name: Generate JavaDocs and run SpotBugs
run: mvn -T1C --no-transfer-progress --color=always -Dmaven.source.skip=true -Dskip.npm -Dskip.bower -Dskip.grunt compile javadoc:javadoc spotbugs:check
- name: Publish SpotBugs report
uses: kpresler/spotbugs-github-action@master
with:
name: 'SpotBugs Report'
path: '**/spotbugsXml.xml'
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
integration-tests:
if: always()
strategy:
matrix:
java: [ '17', '20' ]
db: [ 'h2', 'mariadb', 'postgresql', 'mysql', 'sqlserver', 'db2', 'oracle' ]
runs-on: ubuntu-latest
env:
SPRING_PROFILES_ACTIVE: nflow.db.${{ matrix.db }}
DB_VERSION: ${{ matrix.java == 17 && 'old' || 'latest' }}
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Set up database
run: ./scripts/setup-db-${{ matrix.db }}.sh
- name: Build
run: mvn -T1C --color=always -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true --am -pl nflow-tests install
- name: Run the integration tests
run: mvn -T1C -Dsurefire.forkcount=2C --color=always -P ${{ matrix.db }} -rf :nflow-tests surefire:test
- name: Publish JUnit test report
uses: scacap/action-surefire-report@v1
if: always()
with:
check_name: 'Integration Test Report for Java ${{ matrix.java }} and ${{ matrix.db }}'
- name: Upload test files as artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: 'integrationtest-results-java${{ matrix.java }}-${{ matrix.db }}'
path: '**/target/surefire-reports/*.xml'
retention-days: 7