Skip to content

Commit 9825851

Browse files
chore: Migrating circleci to github actions
1 parent 3401b4d commit 9825851

File tree

3 files changed

+112
-121
lines changed

3 files changed

+112
-121
lines changed

.circleci/config.yml

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

.github/actions/ci/action.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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_type:
12+
description: 'The OS type 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_type == '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_type == '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+
50+
- name: Restore Dependencies
51+
shell: bash
52+
run: ./gradlew dependencies
53+
54+
- name: Build Jar
55+
shell: bash
56+
id: buildjar
57+
run: ./gradlew jar
58+
59+
- name: Build Documentation
60+
shell: bash
61+
run: ./gradlew javadoc
62+
63+
- name: Check Style
64+
shell: bash
65+
run: ./gradlew checkstyleMain
66+
67+
- name: Run Tests
68+
if: steps.buildjar.outcome == 'success'
69+
shell: bash
70+
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/**]
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_type: ubuntu
27+
java_version: ${{ matrix.javaversion }}
28+
29+
build-test-windows:
30+
strategy:
31+
matrix:
32+
os: [windows-latest]
33+
javaversion: [11, 17]
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_type: windows
42+
java_version: ${{ matrix.javaversion }}

0 commit comments

Comments
 (0)