Integration Tests #17
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: Integration Tests | |
on: | |
workflow_dispatch: | |
jobs: | |
create_runner: | |
runs-on: ubuntu-22.04 | |
environment: cstar-d-mcshared | |
permissions: | |
id-token: write | |
outputs: | |
runner_name: ${{ steps.create_github_runner.outputs.runner_name }} | |
steps: | |
- name: Create GitHub Runner | |
id: create_github_runner | |
uses: pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-create-action@ca5ac73f306764b9ec186af3594d905deab50590 | |
with: | |
client_id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant_id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
container_app_environment_name: ${{ secrets.ACA_ENV_NAME }} | |
resource_group_name: ${{ secrets.ACA_ENV_RESOURCE_GROUP_NAME }} | |
pat_token: ${{ secrets.GIT_PAT }} | |
self_hosted_runner_image_tag: "v3.5.1" | |
integration_tests: | |
runs-on: [self-hosted, "${{ needs.create_runner.outputs.runner_name }}"] | |
needs: create_runner | |
environment: cstar-d-mcshared | |
steps: | |
# | |
# Checkout the source code. | |
# | |
- name: Checkout the source code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 | |
# | |
# Setup Java Build Environment. | |
# | |
- name: Setup Java Build Environment | |
uses: pagopa/mil-actions/setup-java-build-env@f782a1b3cdb79afda2c10007ae46b831b31fe640 # 1.1.2 | |
with: | |
gh_user: ${{ secrets.GIT_USER }} | |
gh_token: ${{ secrets.GIT_PAT }} | |
# | |
# Run integration tests. | |
# | |
- name: Run integration tests | |
run: | | |
${{ runner.temp }}/maven/bin/mvn verify \ | |
-s ${{ runner.temp }}/settings.xml \ | |
--no-transfer-progress \ | |
-DskipUTs=true \ | |
-DskipITs=false \ | |
-Dbase_uri=${{ secrets.IT_BASE_URI }} \ | |
-Dadmin_client_id=${{ secrets.IT_ADMIN_CLIENT_ID }} \ | |
-Dadmin_client_secret=${{ secrets.IT_ADMIN_CLIENT_SECRET }} \ | |
-Dtoken_info_client_id=${{ secrets.IT_TOKEN_INFO_CLIENT_ID }} \ | |
-Dtoken_info_client_secret=${{ secrets.IT_TOKEN_INFO_CLIENT_SECRET }} \ | |
-Dtest_username=${{ secrets.IT_TEST_USERNAME }} \ | |
-Dtest_password=${{ secrets.IT_TEST_PASSWORD }} | |
cleanup_runner: | |
if: always() | |
runs-on: ubuntu-22.04 | |
environment: cstar-d-mcshared | |
permissions: | |
id-token: write | |
needs: [create_runner, integration_tests] | |
steps: | |
- name: Cleanup GitHub Runner | |
uses: pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-cleanup-action@0ee2f58fd46d10ac7f00bce4304b98db3dbdbe9a | |
with: | |
client_id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant_id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
resource_group_name: ${{ secrets.ACA_ENV_RESOURCE_GROUP_NAME }} | |
runner_name: ${{ needs.create_runner.outputs.runner_name }} | |
pat_token: ${{ secrets.GIT_PAT }} |