EROPSPT-NONE - Add a build and push action #687
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
- pull_request | |
jobs: | |
build-and-test-api: | |
runs-on: ubuntu-latest | |
env: | |
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} | |
AWS_REGION: eu-west-2 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Installing JDK needs to come after checking out the repo because the action (setup-java) looks for the gradle wrapper files | |
- name: Install JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: corretto | |
java-version: 17 | |
cache: gradle | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.DEV2_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.DEV2_AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-west-2 | |
- name: Run gradle `check` to lint source code and run tests | |
env: | |
AWS_PROFILE_ARG: "" | |
run: ./gradlew clean check --no-daemon | |
- name: Save logs on test failure | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: Test logs | |
path: build/reports/tests/test |