From 0813accc7210f129c178404c54584f2553fe0696 Mon Sep 17 00:00:00 2001 From: Manuel Luypaert Date: Mon, 15 Jan 2024 17:01:10 +0000 Subject: [PATCH] Automatically run API tests through GH actions as PR validation --- .github/workflows/PR-validation.yml | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/PR-validation.yml diff --git a/.github/workflows/PR-validation.yml b/.github/workflows/PR-validation.yml new file mode 100644 index 00000000..5549695c --- /dev/null +++ b/.github/workflows/PR-validation.yml @@ -0,0 +1,47 @@ +name: PR validation +on: + pull_request: + types: [synchronize, opened, reopened, edited] + branches: + - master +jobs: + test-api: + permissions: + id-token: write # Required for authentication through OIDC to AWS + runs-on: ubuntu-22.04 + steps: + - name: Report workflow details + run: | + echo "Repository ${{ github.repository }}." + echo "Trigger ref ${{ github.ref }}, base-ref ${{ github.base_ref }}, head_ref ${{ github.head_ref }}." + - name: Check out repository code + uses: actions/checkout@v3 + - name: Report files updated in PR + run: | + git fetch -q origin ${{ github.base_ref }} ${{ github.head_ref }} + git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + - name: Install clojure and clojure cli (clj) + uses: DeLaGuardo/setup-clojure@12.3 + with: + cli: 1.10.1.536 + - name: Report runtime details + run: | + echo "Github runner OS: ${{ runner.os }}" + - name: AWS credentials configuration + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{secrets.GH_ACTIONS_AWS_ROLE}} + role-session-name: gh-actions-${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-test-api + aws-region: us-east-1 + - name: Generate pom file + run: | + clj -Spom + - name: Run Integration tests + run: | + make run-tests GOOGLE_APP_PROFILE=dev + #TODO: add UI and API build and container packaging test