|
| 1 | +name: PR build and test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [VED-358-github-actions-for-int] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + test-oidc: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + permissions: |
| 12 | + id-token: write |
| 13 | + contents: read |
| 14 | + steps: |
| 15 | + - name: Debug OIDC |
| 16 | + uses: aws-actions/configure-aws-credentials@v4 |
| 17 | + with: |
| 18 | + aws-region: eu-west-2 |
| 19 | + role-to-assume: arn:aws:iam::345594581768:role/auto-ops |
| 20 | + role-session-name: github-actions |
| 21 | + |
| 22 | + - name: Whoami |
| 23 | + run: aws sts get-caller-identity |
| 24 | + |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + fetch-depth: 1 |
| 29 | + |
| 30 | + - name: Set up Python |
| 31 | + id: setup_python |
| 32 | + uses: actions/setup-python@v5 |
| 33 | + with: |
| 34 | + python-version: "3.10" |
| 35 | + |
| 36 | + - name: Install Poetry |
| 37 | + run: | |
| 38 | + curl -sSL https://install.python-poetry.org | python3 - |
| 39 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 40 | +
|
| 41 | + - name: Install dependencies with Poetry (from e2e folder) |
| 42 | + working-directory: ./e2e |
| 43 | + run: | |
| 44 | + poetry install |
| 45 | + |
| 46 | + - uses: hashicorp/setup-terraform@v3 |
| 47 | + with: |
| 48 | + terraform_version: "1.12.2" |
| 49 | + |
| 50 | + - name: Terraform Init |
| 51 | + working-directory: ./terraform |
| 52 | + run: | |
| 53 | + make init |
| 54 | + |
| 55 | + - name: Terraform Plan |
| 56 | + working-directory: ./terraform |
| 57 | + run: | |
| 58 | + make plan environment=dev sub_environment=internal-dev |
| 59 | +
|
| 60 | + - name: Run e2e |
| 61 | + working-directory: ./e2e |
| 62 | + run: | |
| 63 | + apigee_token=$(aws ssm get-parameter \ |
| 64 | + --name "/imms/apigee/non-prod/token" \ |
| 65 | + --with-decryption \ |
| 66 | + --query "Parameter.Value" \ |
| 67 | + --output text) |
| 68 | +
|
| 69 | + status_api_key=$(aws ssm get-parameter \ |
| 70 | + --name "/imms/apigee/non-prod/status-api-key" \ |
| 71 | + --with-decryption \ |
| 72 | + --query "Parameter.Value" \ |
| 73 | + --output text) |
| 74 | + |
| 75 | + export APIGEE_ACCESS_TOKEN=$apigee_token |
| 76 | + |
| 77 | + export APIGEE_ENVIRONMENT=non-prod |
| 78 | + export STATUS_API_KEY=$status_api_key |
| 79 | + export PROXY_NAME=immunisation-fhir-api-internal-dev |
| 80 | + export SERVICE_BASE_PATH=immunisation-fhir-api/FHIR/R4 |
| 81 | + export SSO_LOGIN_URL=https://login.apigee.com |
| 82 | +
|
| 83 | + make run |
0 commit comments