-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (65 loc) · 2.14 KB
/
tests.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
name: Tests
run-name: "Build, run tests, package and deploy"
on:
push:
branches:
- master
pull_request:
paths-ignore:
- '**.md'
jobs:
build:
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: maven
# Build all modules except klass-forvaltning since it is not compatible with JDK 17
- name: Build, test and package with Maven
run: mvn --batch-mode --update-snapshots package -pl '!:klass-forvaltning' -P nexus
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
cache: maven
# Need to downgrade Maven in order to allow HTTP (not HTTPS) packages to be downloaded.
# This is necessary as HTTP repositories were blocked in Maven 3.8.1
# HTTP repositories are used in some outdated dependenciesns
# This step can be removed once KLASS packages have been updated to more recent versions
- name: Set up Maven
uses: stCarolas/[email protected]
with:
maven-version: 3.6.3
# Build only klass-forvaltning with JDK 1.8
- name: Build, test and package with Maven
run: mvn --batch-mode --update-snapshots package -Djava.version=1.8 -pl :klass-forvaltning -am -P github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'pull_request'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: maven
- name: Publish to GitHub Packages
run: mvn --batch-mode deploy -pl '!:klass-forvaltning' -P github -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}