Skip to content

Commit e611e27

Browse files
committed
Fix #2: Move to GitHub Actions
1 parent 1dc995e commit e611e27

File tree

15 files changed

+411
-337
lines changed

15 files changed

+411
-337
lines changed

.github/workflows/default.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Default
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
8+
jobs:
9+
check-gradle-version:
10+
name: Check Gradle version
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/[email protected]
14+
15+
- uses: madhead/check-gradle-version@v1
16+
continue-on-error: true
17+
18+
check-copyright:
19+
name: Check copyright date
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/[email protected]
23+
24+
- run: |
25+
copyright_year=$(sed -n 's/Copyright Ⓒ \([[:digit:]]\{4\}\) madhead <[email protected]>/\1/p' LICENSE)
26+
current_year=$(date +%Y)
27+
echo $copyright_year
28+
echo $current_year
29+
[[ $copyright_year == $current_year ]]
30+
continue-on-error: true
31+
32+
unit-test:
33+
name: Unit test
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
java:
38+
- 8
39+
- 11
40+
- 17
41+
latest-aws-sdk:
42+
- true
43+
- false
44+
env:
45+
ME_MADHEAD_AWS_JUNIT5_USE_LATEST_AWS_SDK: ${{ matrix.latest-aws-sdk }}
46+
CBOR_ENABLED: false
47+
services:
48+
localstack:
49+
image: localstack/localstack
50+
ports:
51+
- 4566:4566
52+
env:
53+
SERVICES: dynamodb,dynamodbstreams,s3,kinesis,firehose,sqs,sns,ses
54+
steps:
55+
- uses: actions/checkout@v2
56+
57+
- uses: actions/setup-java@v2
58+
with:
59+
distribution: adopt
60+
java-version: ${{ matrix.java }}
61+
62+
- uses: gradle/wrapper-validation-action@v1
63+
64+
- run: |
65+
cat .github/workflows/test.env >> $GITHUB_ENV
66+
67+
- run: |
68+
dynamo/seed/seed.sh
69+
s3/seed/seed.sh
70+
kinesis/seed/seed.sh
71+
sns/seed/seed.sh
72+
sqs/seed/seed.sh
73+
ses/seed/seed.sh
74+
75+
- uses: gradle/gradle-build-action@v2
76+
with:
77+
arguments: test jacocoTestReport --stacktrace --scan
78+
79+
- uses: codecov/codecov-action@v2
80+
if: ${{ matrix.java == '8' && matrix.latest-aws-sdk }}
81+
with:
82+
token: ${{ secrets.CODECOV_TOKEN }}
83+
84+
- uses: actions/upload-artifact@v2
85+
if: always()
86+
with:
87+
name: test-results-${{ matrix.java }}-${{ matrix.latest-aws-sdk }}
88+
retention-days: 1
89+
path: |
90+
**/build/reports
91+
**/build/test-results
92+
**/build/jacoco
93+
94+
test-publish:
95+
name: Publish test results
96+
runs-on: ubuntu-latest
97+
strategy:
98+
matrix:
99+
java:
100+
- 8
101+
- 11
102+
- 17
103+
latest-aws-sdk:
104+
- true
105+
- false
106+
needs:
107+
- unit-test
108+
if: always()
109+
steps:
110+
- uses: actions/download-artifact@v2
111+
with:
112+
name: test-results-${{ matrix.java }}-${{ matrix.latest-aws-sdk }}
113+
114+
- uses: mikepenz/action-junit-report@v2
115+
with:
116+
report_paths: "**/test-results/**/TEST-*.xml"

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
OSSRH:
10+
name: OSSRH
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- uses: actions/setup-java@v2
16+
with:
17+
distribution: adopt
18+
java-version: 8
19+
20+
- uses: gradle/wrapper-validation-action@v1
21+
22+
- uses: gradle/gradle-build-action@v2
23+
with:
24+
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
25+
26+
pages:
27+
name: Publish the documentation
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- uses: actions/setup-java@v2
33+
with:
34+
distribution: adopt
35+
java-version: 8
36+
37+
- uses: gradle/wrapper-validation-action@v1
38+
39+
- uses: gradle/gradle-build-action@v2
40+
with:
41+
arguments: javadocs asciidoctor
42+
43+
- run: |
44+
mkdir public
45+
cp -r build/docs/javadoc public/javadoc
46+
cp -r build/docs/asciidoc public/asciidoc
47+
48+
- uses: peaceiris/actions-gh-pages@v3
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
publish_dir: public

.github/workflows/test.env

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
AWS_DEFAULT_REGION=us-east-1
2+
AWS_ACCESS_KEY_ID='accessKey'
3+
AWS_SECRET_ACCESS_KEY='secretKey'
4+
5+
DYNAMODB_URL=http://localhost:4566
6+
DYNAMODB_REGION=us-east-1
7+
DYNAMODB_ACCESS_KEY=accessKey
8+
DYNAMODB_SECRET_KEY=secretKey
9+
10+
DYNAMODB_STREAMS_URL=http://localhost:4566
11+
DYNAMODB_STREAMS_REGION=us-east-1
12+
DYNAMODB_STREAMS_ACCESS_KEY=accessKey
13+
DYNAMODB_STREAMS_SECRET_KEY=secretKey
14+
15+
S3_URL=http://localhost:4566
16+
S3_REGION=us-east-1
17+
S3_ACCESS_KEY=accessKey
18+
S3_SECRET_KEY=secretKey
19+
20+
KINESIS_URL=http://localhost:4566
21+
KINESIS_REGION=us-east-1
22+
KINESIS_ACCESS_KEY=accessKey
23+
KINESIS_SECRET_KEY=secretKey
24+
25+
FIREHOSE_URL=http://localhost:4566
26+
FIREHOSE_REGION=us-east-1
27+
FIREHOSE_ACCESS_KEY=accessKey
28+
FIREHOSE_SECRET_KEY=secretKey
29+
30+
SNS_URL=http://localhost:4566
31+
SNS_REGION=us-east-1
32+
SNS_ACCESS_KEY=accessKey
33+
SNS_SECRET_KEY=secretKey
34+
35+
SQS_URL=http://localhost:4566
36+
SQS_REGION=us-east-1
37+
SQS_ACCESS_KEY=accessKey
38+
SQS_SECRET_KEY=secretKey
39+
40+
SES_URL=http://localhost:4566
41+
SES_REGION=us-east-1
42+
SES_ACCESS_KEY=accessKey
43+
SES_SECRET_KEY=secretKey

.github/workflows/test.sys

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
dynamodb.url=http://localhost:4566
2+
dynamodb.region=us-east-1
3+
dynamodb.accessKey=accessKey
4+
dynamodb.secretKey=secretKey
5+
6+
dynamodbstreams.url=http://localhost:4566
7+
dynamodbstreams.region=us-east-1
8+
dynamodbstreams.accessKey=accessKey
9+
dynamodbstreams.secretKey=secretKey
10+
11+
s3.url=http://localhost:4566
12+
s3.region=us-east-1
13+
s3.accessKey=accessKey
14+
s3.secretKey=secretKey
15+
16+
kinesis.url=http://localhost:4566
17+
kinesis.region=us-east-1
18+
kinesis.accessKey=accessKey
19+
kinesis.secretKey=secretKey
20+
21+
firehose.url=http://localhost:4566
22+
firehose.region=us-east-1
23+
firehose.accessKey=accessKey
24+
firehose.secretKey=secretKey
25+
26+
sns.url=http://localhost:4566
27+
sns.region=us-east-1
28+
sns.accessKey=accessKey
29+
sns.secretKey=secretKey
30+
31+
sqs.url=http://localhost:4566
32+
sqs.region=us-east-1
33+
sqs.accessKey=accessKey
34+
sqs.secretKey=secretKey
35+
36+
ses.url=http://localhost:4566
37+
ses.region=us-east-1
38+
ses.accessKey=accessKey
39+
ses.secretKey=secretKey

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 madhead <[email protected]>
3+
Copyright Ⓒ 2022 madhead <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ configure(
9090
}
9191
scm {
9292
connection.set("scm:git:[email protected]:madhead/aws-junit5.git")
93-
developerConnection.set("scm:git:[email protected]:madhead/aws-junit5.git")
9493
url.set("https://github.com/madhead/aws-junit5")
9594
}
9695
}
@@ -99,13 +98,13 @@ configure(
9998
}
10099

101100
configure<JacocoPluginExtension> {
102-
toolVersion = "0.8.6"
101+
toolVersion = "0.8.7"
103102
}
104103

105104
tasks {
106105
withType<Test> {
107106
systemProperties = Properties().apply {
108-
load(File(rootDir, "gitlab/test.sys").bufferedReader())
107+
load(File(rootDir, ".github/workflows/test.sys").bufferedReader())
109108
}.mapKeys { entry -> entry.key.toString() }
110109
useJUnitPlatform()
111110
testLogging {

common/v1/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
dependencies {
22
// By default, the code is compiled against the lowest supported AWS SDK versions.
3-
// If BY_DEV_MADHEAD_AWS_JUNIT5_USE_LATEST_AWS_SDK environment variable is set to true we want to test the
3+
// If ME_MADHEAD_AWS_JUNIT5_USE_LATEST_AWS_SDK environment variable is set to true we want to test the
44
// code against the latest available AWS SDK versions.
5-
val v1: String = if (System.getenv("BY_DEV_MADHEAD_AWS_JUNIT5_USE_LATEST_AWS_SDK") == "true") {
5+
val v1: String = if (System.getenv("ME_MADHEAD_AWS_JUNIT5_USE_LATEST_AWS_SDK") == "true") {
66
"1.+"
77
} else {
88
"1.11.79"

common/v2/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
dependencies {
22
// By default, the code is compiled against the lowest supported AWS SDK versions.
3-
// If BY_DEV_MADHEAD_AWS_JUNIT5_USE_LATEST_AWS_SDK environment variable is set to true we want to test the
3+
// If ME_MADHEAD_AWS_JUNIT5_USE_LATEST_AWS_SDK environment variable is set to true we want to test the
44
// code against the latest available AWS SDK versions.
5-
val v2: String = if (System.getenv("BY_DEV_MADHEAD_AWS_JUNIT5_USE_LATEST_AWS_SDK") == "true") {
5+
val v2: String = if (System.getenv("ME_MADHEAD_AWS_JUNIT5_USE_LATEST_AWS_SDK") == "true") {
66
"2.+"
77
} else {
88
"2.5.3"

0 commit comments

Comments
 (0)