-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (94 loc) · 3.21 KB
/
build_girders.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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# See: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Build Girders
on:
schedule:
# schedule multiple times because GitHub does not guarantee a scheduled job to run:
# https://github.community/t/no-assurance-on-scheduled-jobs/133753/2
- cron: '0 0,1,2,3 * * 5'
push:
create:
release:
types: [created]
workflow_dispatch:
jobs:
build_girders:
name: build girders
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17.0.0'
distribution: 'zulu'
cache: 'maven'
server-id: 'ossrh' # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # same name as below env variable
server-password: MAVEN_PASSWORD # same name as below env variable
gpg-private-key: ${{ secrets.PGP_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE # same name as below env variable
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: build girders
run: |
mvn --batch-mode clean
mvn --batch-mode -Ppedantic deploy
shell: bash
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
- name: upload surefire report
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: surefire-reports
path: girders-demos/girders-demo-test/target/surefire-reports/
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=girders-java
integration_tests_21:
name: Integration tests for Java 21
runs-on: ubuntu-latest
needs: build_girders
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21.0.0'
distribution: 'zulu'
cache: 'maven'
- name: run integration tests
run: mvn --batch-mode -f girders-demos/girders-demo-test/pom.xml install
integration_tests_17:
name: Integration tests for Java 17
runs-on: ubuntu-latest
needs: build_girders
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17.0.0'
distribution: 'zulu'
cache: 'maven'
- name: run integration tests
run: mvn --batch-mode -f girders-demos/girders-demo-test/pom.xml install