Skip to content

AUT-3749: Log message when authentication successful #13369

AUT-3749: Log message when authentication successful

AUT-3749: Log message when authentication successful #13369

name: Pre-merge checks
env:
JAVA_VERSION: "17"
JAVA_DISTRIBUTION: "corretto"
on:
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
merge_group:
jobs:
check-openapi-specs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: 3.12
- name: Install dependencies
run: |
pip install pyyaml
- name: Check OpenAPI specs
shell: bash
run: |
find ci/terraform -type f -name "*openapi*.yaml" -exec python scripts/validate_openapi_definition.py {} \;
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 17
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 #v4.3.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
with:
gradle-version: wrapper
cache-read-only: false
- name: Build Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
.gradle/
*/build/
!*/build/reports
!*/build/jacoco
key: ${{ runner.os }}-build-${{ github.sha }}
- name: Run Build
run: ./gradlew --parallel build -x test -x account-management-integration-tests:test -x spotlessApply -x spotlessCheck
style-checks:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Check out repository code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 17
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 #v4.3.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
with:
gradle-version: wrapper
cache-read-only: true
- name: Restore Build Cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
.gradle/
*/build/
!*/build/reports
!*/build/jacoco
key: ${{ runner.os }}-build-${{ github.sha }}
- name: Run Spotless
run: ./gradlew --no-daemon spotlessCheck
run-unit-tests:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Check out repository code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 17
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 #v4.3.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
with:
gradle-version: wrapper
cache-read-only: true
- name: Restore Build Cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
.gradle/
*/build/
!*/build/reports
!*/build/jacoco
key: ${{ runner.os }}-build-${{ github.sha }}
- name: Run Unit Tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew --parallel test jacocoTestReport -x integration-tests:test -x account-management-integration-tests:test -x delivery-receipts-integration-tests:test -x spotlessApply -x spotlessCheck
- name: Cache Unit Test Reports
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-unit-test-reports-${{ github.sha }}
path: |
*/build/jacoco/
*/build/reports/
!integration-tests/build/jacoco/
!integration-tests/build/reports/
!account-management-integration-tests/build/jacoco/
!account-management-integration-tests/build/reports/
!delivery-receipts-integration-tests/build/jacoco/
!delivery-receipts-integration-tests/build/reports/
- name: Upload Unit Test Reports
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: failure()
with:
name: unit-test-reports
path: |
*/build/reports/
!integration-tests/build/reports/
!account-management-integration-tests/build/reports/
!delivery-receipts-integration-tests/build/reports/
retention-days: 5
run-integration-tests:
runs-on: ubuntu-latest
needs:
- build
services:
localstack:
image: localstack/localstack:3.0.0
env:
SERVICES: "lambda, apigateway, iam, ec2, sqs, s3, sts, kms, sns, ssm, events"
GATEWAY_LISTEN: 0.0.0.0:45678
LOCALSTACK_HOST: localhost:45678
TEST_AWS_ACCOUNT_ID: 123456789012
options: >-
--add-host "notify.internal:host-gateway"
--add-host "subscriber.internal:host-gateway"
ports:
- 45678:45678
redis:
image: redis:6.0.5-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
dynamodb:
image: amazon/dynamodb-local:1.22.0
options: >-
--health-cmd "curl http://localhost:8000"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 8000:8000
steps:
- name: Check out repository code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 17
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 #v4.3.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
with:
gradle-version: wrapper
cache-read-only: true
- name: Restore Build Cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
.gradle/
*/build/
!*/build/reports
!*/build/jacoco
key: ${{ runner.os }}-build-${{ github.sha }}
- name: Run Integration Tests
run: |
./gradlew :integration-tests:test :integration-tests:jacocoTestReport -x spotlessApply -x spotlessCheck -x composeUp
- name: Cache Test Reports
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-integration-test-reports-${{ github.sha }}
path: |
integration-tests/build/jacoco/
integration-tests/build/reports/
- name: Upload Integration Test Reports
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: failure()
with:
name: integration-test-reports
path: integration-tests/build/reports/tests/test/
retention-days: 5
run-account-management-and-delivery-receipts-tests:
runs-on: ubuntu-latest
needs:
- build
services:
localstack:
image: localstack/localstack:3.0.0
env:
SERVICES: "lambda, apigateway, iam, ec2, sqs, s3, sts, kms, sns, ssm, events"
DEFAULT_REGION: eu-west-2
GATEWAY_LISTEN: 0.0.0.0:45678
LOCALSTACK_HOST: localhost:45678
TEST_AWS_ACCOUNT_ID: 123456789012
KMS_PROVIDER: local-kms
options: >-
--add-host "notify.internal:host-gateway"
--add-host "subscriber.internal:host-gateway"
ports:
- 45678:45678
redis:
image: redis:6.0.5-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
dynamodb:
image: amazon/dynamodb-local:1.22.0
options: >-
--health-cmd "curl http://localhost:8000"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 8000:8000
steps:
- name: Check out repository code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 17
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 #v4.3.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
with:
gradle-version: wrapper
cache-read-only: true
- name: Restore Build Cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
.gradle/
*/build/
!*/build/reports
!*/build/jacoco
key: ${{ runner.os }}-build-${{ github.sha }}
- name: Run Account Management Integration Tests
run: |
./gradlew :account-management-integration-tests:test :account-management-integration-tests:jacocoTestReport -x spotlessApply -x spotlessCheck -x composeUp
- name: Upload Account Management Integration Test Reports
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: failure()
with:
name: account-management-integration-test-reports
path: account-management-integration-tests/build/reports/tests/test/
retention-days: 5
- name: Run Delivery Receipts Integration Tests
run: |
./gradlew :delivery-receipts-integration-tests:test :delivery-receipts-integration-tests:jacocoTestReport -x spotlessApply -x spotlessCheck -x composeUp
- name: Cache Test Reports
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-am-dr-integration-test-reports-${{ github.sha }}
path: |
account-management-integration-tests/build/jacoco/
account-management-integration-tests/build/reports/
delivery-receipts-integration-tests/build/jacoco/
delivery-receipts-integration-tests/build/reports/
- name: Upload Account Management Integration Test Reports
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: failure()
with:
name: delivery-receipts-integration-test-reports
path: delivery-receipts-integration-tests/build/reports/tests/test/
retention-days: 5
run-sonar-analysis:
runs-on: ubuntu-latest
needs:
- run-unit-tests
- run-integration-tests
- run-account-management-and-delivery-receipts-tests
if: github.event_name != 'merge_group'
steps:
- name: Check out repository code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 #v4.3.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
with:
gradle-version: wrapper
cache-read-only: true
- name: Restore Build Cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
.gradle/
*/build/
!*/build/reports
!*/build/jacoco
key: ${{ runner.os }}-build-${{ github.sha }}
- name: Restore Cached Unit Test Reports
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-unit-test-reports-${{ github.sha }}
path: |
*/build/jacoco/
*/build/reports/
!integration-tests/build/jacoco/
!integration-tests/build/reports/
!account-management-integration-tests/build/jacoco/
!account-management-integration-tests/build/reports/
!delivery-receipts-integration-tests/build/jacoco/
!delivery-receipts-integration-tests/build/reports/
- name: Restore Cached Integration Test Reports
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-integration-test-reports-${{ github.sha }}
path: |
integration-tests/build/jacoco/
integration-tests/build/reports/
- name: Restore Cached AM DR Integration Test Reports
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-am-dr-integration-test-reports-${{ github.sha }}
path: |
account-management-integration-tests/build/jacoco/
account-management-integration-tests/build/reports/
delivery-receipts-integration-tests/build/jacoco/
delivery-receipts-integration-tests/build/reports/
- name: Run SonarCloud Analysis
if: ${{ github.actor != 'dependabot[bot]' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew testCodeCoverageReport sonar -x test -x account-management-integration-tests:test -x spotlessApply -x spotlessCheck