Skip to content

Commit fe8f93f

Browse files
committed
e2e in workflow
1 parent 62b270c commit fe8f93f

File tree

2 files changed

+104
-23
lines changed

2 files changed

+104
-23
lines changed

.github/workflows/pr-deploy-to-int.yml

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ on:
44
push:
55
branches: [VED-358-github-actions-for-int]
66
workflow_dispatch:
7-
inputs:
8-
dummy:
9-
description: 'Manual trigger (optional input)'
10-
required: false
11-
default: ''
127

138
jobs:
149
test-oidc:
@@ -37,29 +32,32 @@ jobs:
3732
terraform_version: "1.12.2"
3833

3934
- name: Terraform Init
40-
working-directory: ./terraform_old
35+
working-directory: ./terraform
4136
run: |
4237
make init
4338
4439
- name: Terraform Plan
45-
working-directory: ./terraform_old
40+
working-directory: ./terraform
4641
run: |
4742
make plan environment=green aws_account_name=int
4843
49-
# - name: Set up Python
50-
# id: setup_python
51-
# uses: actions/setup-python@v5
52-
# with:
53-
# python-version: "3.10.16" # this is for e2e tests
5444
55-
# - name: cache virtualenv
56-
# uses: actions/cache@v4
57-
# id: cache-venv
58-
# with:
59-
# path: ./.venv/
60-
# key: ${{ hashFiles('**/*requirements.txt') }}
61-
# restore-keys: ${{ hashFiles('**/*requirements.txt') }}
62-
63-
# - name: Install dependencies
64-
# if: steps.cache-venv.outputs.cache-hit != 'true'
65-
# run: make install-dev-requirements
45+
# # --- APPROVAL REQUIRED HERE ---
46+
# manual-approval:
47+
# needs: test-oidc
48+
# runs-on: ubuntu-latest
49+
# environment:
50+
# name: int-approval
51+
# # protection rules set in GitHub UI will pause here until approval
52+
# steps:
53+
# - name: Wait for approval
54+
# run: echo "Waiting for manual approval..."
55+
56+
# terraform-apply:
57+
# needs: manual-approval
58+
# runs-on: ubuntu-latest
59+
# steps:
60+
# - name: Terraform Apply
61+
# working-directory: ./terraform_old
62+
# run: |
63+
# make plan environment=green aws_account_name=int
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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

Comments
 (0)