From 9d41d197417649409d24e293e68f388b0818e162 Mon Sep 17 00:00:00 2001 From: dmoini Date: Mon, 11 Dec 2023 15:50:56 -0800 Subject: [PATCH] Added GitHub CI workflow (#19) --- .github/workflows/java-ci-with-maven.yml | 55 ++++++++++++++++++++++++ .pre-commit-config.yaml | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/java-ci-with-maven.yml diff --git a/.github/workflows/java-ci-with-maven.yml b/.github/workflows/java-ci-with-maven.yml new file mode 100644 index 0000000..273f401 --- /dev/null +++ b/.github/workflows/java-ci-with-maven.yml @@ -0,0 +1,55 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Java CI with Maven + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + env: + AWS_DEFAULT_REGION: us-east-1 + AWS_REGION: us-east-1 + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install jinja2 with 2.11.3 to resolve incompatible issue + run: pip install jinja2==2.11.3 + - name: Set up cloudformation-cli-java-plugin + run: pip install cloudformation-cli-java-plugin + - name: install and run pre-commit + uses: pre-commit/action@v2.0.0 + with: + extra_args: --all-files + - name: Run maven verify for all resources + run: | + for directory in $GITHUB_WORKSPACE/aws-*; do + cd "$directory" + mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean verify + done + - name: Check failure log + if: ${{ failure() }} + run: | + for directory in $GITHUB_WORKSPACE/aws-*; do + cd "$directory" + if [[ -f "rpdk.log" ]] + then + cat "rpdk.log" + fi + done + - name: Failure diff + if: ${{ failure() }} + run: git diff diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 294b01a..1d064f4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,4 +15,4 @@ repos: - --no-sort-keys - id: check-merge-conflict - id: check-yaml - exclude: codebuild-ci.yaml \ No newline at end of file + exclude: codebuild-ci.yaml