-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (53 loc) · 1.8 KB
/
e2e-prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Pre-production end to end tests
on:
pull_request:
branches:
- prod
# TODO make dependent on no deploy jobs running
jobs:
get-deployment:
runs-on: ubuntu-latest
container: hashicorp/terraform:1.1.6
steps:
- uses: actions/checkout@v2
- name: Get branch name
run: echo "##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF#refs/heads/})"
id: branch
- name: Terraform output
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cd terraform
printf "terraform {\n backend \"s3\" {}\n}" > state.tf
terraform init \
-backend-config="bucket=${{ secrets.TERRAFORM_STATE_S3_BUCKET }}" \
-backend-config="key=${{ steps.branch.outputs.branch }}" \
-backend-config="region=${{ secrets.AWS_DEFAULT_REGION }}" \
-backend-config="encrypt=true" \
-backend-config="dynamodb_table=${{ secrets.TERRAFORM_LOCK_DYNAMODB_TABLE }}"
BACKEND_HOST=https://$(terraform output -raw cf_endpoint)
printf "{\n \"baseUrl\": \"$BACKEND_HOST\"\n}\n" > cypress.json
- name: Upload hostname
uses: actions/upload-artifact@v3
with:
name: cypress
path: terraform/cypress.json
e2e-prod:
runs-on: ubuntu-latest
container: cypress/browsers:node12.18.3-chrome87-ff82
needs:
- get-deployment
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download hostname
uses: actions/download-artifact@v3
with:
name: cypress
path: tests
- name: Run e2e tests
uses: cypress-io/github-action@v2
with:
browser: chrome
working-directory: tests