Skip to content

chore: Migrating circleci to github actions #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 0 additions & 121 deletions .circleci/config.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Shared CI Workflow

inputs:
java_version:
description: 'The Java version to use.'
required: true
java_distribution:
description: 'The Java distribution to use.'
required: false
default: temurin
os_type:
description: 'The OS type to use.'
required: false
default: ubuntu
options:
- ubuntu
- windows

runs:
using: composite
steps:
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: ${{ inputs.java_distribution }}
java-version: ${{ inputs.java_version }}

- name: Copy gradle.properties
shell: bash
run: |
cp gradle.properties.example gradle.properties

- name: Setup DynamoDB Service
if: inputs.os_type == 'ubuntu'
shell: bash
run: |
sudo docker run -d -p 8000:8000 amazon/dynamodb-local

- name: Setup DynamoDB Service
if: inputs.os_type == 'windows'
shell: pwsh
run: |
$ProgressPreference = "SilentlyContinue"
iwr -outf dynamo.zip https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip
mkdir dynamo
Expand-Archive -Path dynamo.zip -DestinationPath dynamo
cd dynamo
Start-Process -FilePath "java" -ArgumentList "-D`"java.library.path=./DynamoDBLocal_lib`"","-jar","DynamoDBLocal.jar"

- name: Restore Dependencies
shell: bash
run: ./gradlew dependencies

- name: Build Jar
shell: bash
id: buildjar
run: ./gradlew jar

- name: Build Documentation
shell: bash
run: ./gradlew javadoc

- name: Check Style
shell: bash
run: ./gradlew checkstyleMain

- name: Run Tests
if: steps.buildjar.outcome == 'success'
shell: bash
run: ./gradlew test
42 changes: 42 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Test

on:
push:
branches: [main, feat/**]
paths-ignore:
- '**.md' #Do not need to run CI for markdown changes.
pull_request:
branches: [main, feat/**]
paths-ignore:
- '**.md'

jobs:
build-test-linux:
strategy:
matrix:
os: [ubuntu-latest]
javaversion: [8, 11, 17, 19]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Shared CI Steps
uses: ./.github/actions/ci
with:
os_type: ubuntu
java_version: ${{ matrix.javaversion }}

build-test-windows:
strategy:
matrix:
os: [windows-latest]
javaversion: [11, 17]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Shared CI Steps
uses: ./.github/actions/ci
with:
os_type: windows
java_version: ${{ matrix.javaversion }}