-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.45 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
name: 'Test PR'
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
version-bump:
name: 'Version Bump'
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
# fetch-depth 0 means deep clone the repo
fetch-depth: 0
- name: 'Update version'
run: |
set -x
git config user.name devops
git config user.email [email protected]
./package/version.sh bump $(git show origin/${GITHUB_BASE_REF}:package/version)
./package/version.sh sub
if git add --update && git commit --message "Set Version: $(cat package/version)"; then
git push origin HEAD:${GITHUB_HEAD_REF}
fi
tests:
needs: version-bump
name: 'Run tests'
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
submodules: recursive
- name: 'Set up Java 17'
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: 'Install Maven'
run: sudo apt-get update && sudo apt-get install --yes maven
- name: 'Check code is formatted correctly'
run: mvn spotless:check --batch-mode -U
- name: 'Run tests'
run: mvn verify --batch-mode -U