-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (39 loc) · 1.62 KB
/
maven-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
name: Maven Test
on:
workflow_call:
inputs:
time-zone:
required: false
default: "Europe/Amsterdam"
type: string
jobs:
maven-test:
runs-on: ubuntu-24.04
env:
TZ: ${{ inputs.time-zone }}
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: AWS Credentials
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::917951871879:role/GitHubActionsBgOrg
- name: Get CodeArtifact Authorization Token
run: |
codeartifact_auth_token=$(aws codeartifact get-authorization-token --domain nisv-ateam --domain-owner 917951871879 --region eu-west-1 --query authorizationToken --output text)
echo "::add-mask::$codeartifact_auth_token"
echo "CODEARTIFACT_AUTH_TOKEN=$codeartifact_auth_token" >> "$GITHUB_ENV"
- name: Set up JDK
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: 'temurin'
java-version-file: '.java-version'
cache: 'maven'
cache-dependency-path: 'pom.xml'
- name: Set Maven settings.xml
run: echo "${{ vars.MAVEN_CODE_ARTIFACT_SETTINGS }}" | base64 --decode > ~/.m2/settings.xml
- name: Maven test
run: |
mvn -B -U -fae clean install || { echo "Maven tests failed."; exit 1; }