Skip to content

Commit 924c7d0

Browse files
test: Add new CI build targets (#44)
1 parent f4f0987 commit 924c7d0

File tree

5 files changed

+117
-32
lines changed

5 files changed

+117
-32
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
required: true
8+
type: string
9+
distribution:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
Build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
id-token: write
18+
contents: read
19+
20+
steps:
21+
- name: Configure AWS Credentials
22+
uses: aws-actions/configure-aws-credentials@v1
23+
with:
24+
role-to-assume: arn:aws:iam::${{ secrets.CI_AWS_ACCOUNT_ID }}:role/service-role/S3EC-GitHub-test-role
25+
role-session-name: S3EC-Github-CI-Tests
26+
aws-region: us-west-2
27+
28+
- name: Checkout Code
29+
uses: actions/checkout@v3
30+
31+
# TODO: Add OpenJDK
32+
# OpenJDK would require a different action than setup-java, so setup is more involved.
33+
34+
- name: Setup JDK
35+
uses: actions/setup-java@v3
36+
with:
37+
distribution: ${{ inputs.distribution }}
38+
java-version: ${{ inputs.version}}
39+
cache: 'maven'
40+
41+
- name: Compile
42+
run: |
43+
mvn clean compile
44+
mvn test-compile
45+
shell: bash
46+
47+
- name: Test
48+
run: |
49+
export AWS_S3EC_TEST_BUCKET=s3ec-github-test-bucket
50+
export AWS_S3EC_TEST_KMS_KEY_ID=arn:aws:kms:us-west-2:${{ secrets.CI_AWS_ACCOUNT_ID }}:key/c3eafb5f-e87d-4584-9400-cf419ce5d782
51+
export AWS_S3EC_TEST_KMS_KEY_ALIAS=arn:aws:kms:us-west-2:${{ secrets.CI_AWS_ACCOUNT_ID }}:alias/S3EC-Github-KMS-Key
52+
export AWS_REGION=us-west-2
53+
mvn -B -ntp test -DskipCompile
54+
shell: bash
55+
56+
- name: Package JAR
57+
run: |
58+
mvn install -DskipTests
59+
shell: bash

.github/workflows/ci-test.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/ci-workflow.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Continuous Integration Workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
Static_Analysis:
9+
uses: ./.github/workflows/static-analysis.yml
10+
11+
Build:
12+
strategy:
13+
max-parallel: 1 # TODO: Fix jobs failing when running in parallel
14+
matrix:
15+
version: [ 8, 11, 17 ]
16+
distribution: [ corretto, temurin ] # TODO: Add OpenJDK
17+
uses: ./.github/workflows/build.yml
18+
secrets: inherit
19+
with:
20+
version: ${{ matrix.version }}
21+
distribution: ${{ matrix.distribution }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Static Analysis
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
SpotBugs:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
id-token: write
11+
contents: read
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
- name: Run SpotBugs
17+
run: mvn -B -ntp com.github.spotbugs:spotbugs-maven-plugin:check
18+
shell: bash

pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,25 @@
173173
<goals>
174174
<goal>check</goal>
175175
</goals>
176+
<configuration>
177+
<rules>
178+
<rule>
179+
<element>BUNDLE</element>
180+
<limits>
181+
<limit>
182+
<counter>INSTRUCTION</counter>
183+
<value>COVEREDRATIO</value>
184+
<minimum>0.8</minimum>
185+
</limit>
186+
<limit>
187+
<counter>BRANCH</counter>
188+
<value>COVEREDRATIO</value>
189+
<minimum>0.7</minimum>
190+
</limit>
191+
</limits>
192+
</rule>
193+
</rules>
194+
</configuration>
176195
</execution>
177196
</executions>
178197
</plugin>

0 commit comments

Comments
 (0)