Skip to content

Commit 494a023

Browse files
wip: Migrating circleci to github actions
1 parent 3401b4d commit 494a023

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed

.github/actions/ci/action.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Shared CI Workflow
2+
3+
inputs:
4+
java_version:
5+
description: 'The Java version to use.'
6+
required: true
7+
java_distribution:
8+
description: 'The Java distribution to use.'
9+
required: false
10+
default: temurin
11+
os:
12+
description: 'The OS to use.'
13+
required: false
14+
default: ubuntu
15+
options:
16+
- ubuntu
17+
- windows
18+
19+
runs:
20+
using: composite
21+
steps:
22+
- name: Setup Java
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: ${{ inputs.java_distribution }}
26+
java-version: ${{ inputs.java_version }}
27+
28+
- name: Copy gradle.properties
29+
shell: bash
30+
run: |
31+
cp gradle.properties.example gradle.properties
32+
33+
- name: Setup DynamoDB Service
34+
if: inputs.os == 'ubuntu'
35+
shell: bash
36+
run: |
37+
sudo docker run -d -p 8000:8000 amazon/dynamodb-local
38+
39+
- name: Setup DynamoDB Service
40+
if: inputs.os == 'windows'
41+
shell: pwsh
42+
run: |
43+
$ProgressPreference = "SilentlyContinue"
44+
iwr -outf dynamo.zip https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip
45+
mkdir dynamo
46+
Expand-Archive -Path dynamo.zip -DestinationPath dynamo
47+
cd dynamo
48+
Start-Process -FilePath "java" -ArgumentList "-D`"java.library.path=./DynamoDBLocal_lib`"","-jar","DynamoDBLocal.jar"
49+
#javaw -D"java.library.path=./DynamoDBLocal_lib" -jar DynamoDBLocal.jar
50+
51+
- name: Restore Dependencies
52+
shell: bash
53+
run: ./gradlew dependencies
54+
55+
- name: Build Jar
56+
shell: bash
57+
id: buildjar
58+
run: ./gradlew jar
59+
60+
- name: Build Documentation
61+
shell: bash
62+
run: ./gradlew javadoc
63+
64+
- name: Check Style
65+
shell: bash
66+
run: ./gradlew checkstyleMain
67+
68+
- name: Run Tests
69+
if: steps.buildjar.outcome == 'success'
70+
shell: bash
71+
env:
72+
AWS_ACCESS_KEY_ID: fakeAccessKeyId
73+
AWS_SECRET_ACCESS_KEY: fakeSecretAccessKey
74+
AWS_REGION: fakeRegion
75+
run: ./gradlew test

.github/workflows/build-test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [main, feat/**, abarker/**]
6+
paths-ignore:
7+
- '**.md' #Do not need to run CI for markdown changes.
8+
pull_request:
9+
branches: [main, feat/**]
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
# build-test-linux:
15+
# strategy:
16+
# matrix:
17+
# os: [ubuntu-latest]
18+
# javaversion: [8, 11, 17, 19]
19+
# runs-on: ${{ matrix.os }}
20+
# steps:
21+
# - uses: actions/checkout@v3
22+
23+
# - name: Shared CI Steps
24+
# uses: ./.github/actions/ci
25+
# with:
26+
# os: ubuntu
27+
# java_version: ${{ matrix.javaversion }}
28+
29+
build-test-windows:
30+
strategy:
31+
matrix:
32+
os: [windows-latest]
33+
javaversion: [11]
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- uses: actions/checkout@v3
37+
38+
- name: Shared CI Steps
39+
uses: ./.github/actions/ci
40+
with:
41+
os: windows
42+
java_version: ${{ matrix.javaversion }}

0 commit comments

Comments
 (0)