-
Notifications
You must be signed in to change notification settings - Fork 6
31 lines (29 loc) · 1.15 KB
/
continuous-integration.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
name: Run Tests
on: [push, pull_request]
jobs:
runtests:
runs-on: ubuntu-latest
container:
image: ghcr.io/quattor/quattor-test-container:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Determine hash for caching key
id: cachekeystep
run: echo "pomcachekey=${{ hashFiles('**/pom.xml') }}" >> $GITHUB_ENV
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: /tmp/m2
key: ${{ runner.os }}-m2-${{ env.pomcachekey }}
restore-keys: ${{ runner.os }}-m2-
- name: run tests
run: |
# make sure it exists before chown
mkdir -p /tmp/m2
chown -R quattortest:quattortest . /tmp/m2
# we have to run as a non-root user to pass the spma tests
# secondly, we first download all maven dependencies and then run the tests because it fails with hanging downloads otherwise.
runuser --shell /bin/bash --preserve-environment --command "source /usr/bin/mvn_test.sh && mvn_run \"dependency:resolve-plugins dependency:go-offline $MVN_ARGS\" && mvn_test" quattortest
env:
MVN_ARGS: -Dmaven.repo.local=/tmp/m2