Repopulate My Vaccs Preprod Data #61
This file contains hidden or 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: Repopulate My Vaccs Preprod Data | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| secrets: | |
| ELID_PREPROD_AWS_ACCOUNT_ID: | |
| required: true | |
| jobs: | |
| run-vita-int-tests: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| runs-on: ubuntu-22.04 | |
| environment: preprod | |
| steps: | |
| - name: Verify caller repository | |
| run: | | |
| ALLOWED_REPOS=("NHSDigital/eligibility-signposting-api" "NHSDigital/vaccinations-app") | |
| CALLER_REPO="${{ github.repository }}" | |
| # If triggered by workflow_call, the calling repo is in github.repository | |
| # If triggered manually, it's this repo itself which is allowed | |
| if [[ "${{ github.event_name }}" == "workflow_call" ]]; then | |
| CALLER_REPO="${{ github.event.workflow_run.repository.full_name || github.repository }}" | |
| fi | |
| ALLOWED=false | |
| for repo in "${ALLOWED_REPOS[@]}"; do | |
| if [[ "$CALLER_REPO" == "$repo" ]]; then | |
| ALLOWED=true | |
| break | |
| fi | |
| done | |
| if [[ "$ALLOWED" == "false" && "${{ github.event_name }}" == "workflow_call" ]]; then | |
| echo "Error: Repository $CALLER_REPO is not allowed to trigger this workflow" | |
| exit 1 | |
| fi | |
| echo "Workflow triggered by allowed repository: $CALLER_REPO" | |
| - name: Checkout main | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| repository: NHSDigital/eligibility-signposting-api-regression-tests | |
| ref: main | |
| - name: Install asdf | |
| uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47 | |
| with: | |
| asdf_version: 0.18.0 | |
| - name: Cache asdf | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.asdf | |
| key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }} | |
| - name: Install asdf dependencies | |
| uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47 | |
| with: | |
| asdf_version: 0.18.0 | |
| env: | |
| PYTHON_CONFIGURE_OPTS: --enable-shared | |
| - name: Cache Virtualenv | |
| uses: actions/cache@v5 | |
| id: cache-venv | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-venv-${{ hashFiles('pyproject.toml') }} | |
| - name: Install Dependencies | |
| if: steps.cache-venv.outputs.cache-hit != 'true' | |
| run: make install | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v6.1.0 | |
| with: | |
| role-to-assume: arn:aws:iam::${{ secrets.ELID_PREPROD_AWS_ACCOUNT_ID }}:role/Eligibility-Signposting-API-E2E-Regression-Tests | |
| aws-region: eu-west-2 | |
| - name: Run Vita Integration Tests | |
| run: make run-vita-preprod-tests |