-
Notifications
You must be signed in to change notification settings - Fork 130
131 lines (111 loc) · 4.61 KB
/
cypress-integration-test.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Cypress Integration Test Workflow
on:
workflow_dispatch:
inputs:
branch:
description: 'select main in the above roster and then input the branch name with CI failures'
required: true
product:
description: 'your target product directory within src/applications'
required: true
# TO-DO: create a solution that maintains an updated list of active products within src/applications
# TO-DO: add a commit input to allow devs to determine a commit point of failure in the branch
env:
BUILDTYPE: vagovprod
VETS_WEBSITE_CHANNEL_ID: ''
jobs:
validate-and-set-product-selection:
name: Set product directory for testing
runs-on: ubuntu-latest
steps:
- name: Run integration helper script
run: |
chmod +x ./script/github-actions/cypress-integration-test.sh
./scripts/integration-helper.sh "${{ github.ref }}"
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Install dependencies
uses: ./.github/workflows/install
timeout-minutes: 30
with:
key: ${{ hashFiles('yarn.lock') }}
yarn_cache_folder: .cache/yarn
path: |
.cache/yarn
node_modules
- name: Configure AWS Credentials
uses: ./.github/workflows/configure-aws-credentials
with:
aws_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: us-gov-west-1
- name: Get va-vsp-bot token
uses: ./.github/workflows/inject-secrets
with:
ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN
env_variable_name: VA_VSP_BOT_GITHUB_TOKEN
- name: Get Mapbox Token
uses: ./.github/workflows/inject-secrets
with:
ssm_parameter: /dsva-vagov/vets-website/dev/mapbox_token
env_variable_name: MAPBOX_TOKEN
- name: Build
run: yarn build --verbose --buildtype=${{ env.BUILDTYPE }}
timeout-minutes: 30
- name: Generate build details
run: |
cat > build/${{ env.BUILDTYPE }}/BUILD.txt << EOF
BUILDTYPE=${{ env.BUILDTYPE }}
NODE_ENV=production
BRANCH_NAME=$(echo "${GITHUB_REF#refs/heads/}")
CHANGE_TARGET=null
RUN_ID=${{ github.run_id }}
RUN_NUMBER=${{ github.run_number }}
REF=${{ github.sha }}
BUILDTIME=$(date +%s)
EOF
- name: Compress and archive build
run: tar -C build/${{ env.BUILDTYPE }} -cjf ${{ env.BUILDTYPE }}.tar.bz2 .
- name: Upload build artifact
uses: ./.github/workflows/upload-artifact
with:
name: ${{ env.BUILDTYPE }}.tar.bz2
path: ${{ env.BUILDTYPE }}.tar.bz2
retention-days: 1
checkout-vets-website:
name: Checkout vets-website
uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
checkout-target-repo:
name: Checkout Cypress Integration Tests repo
uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
with:
repository: department-of-veterans-affairs/vagov-cypress-integration-tests
token: ${{ env.VA_VSP_BOT_GITHUB_TOKEN }}
path: vagov-cypress-integration-tests
call-integration-test-workflow:
name: Call Integration Test Workflow
uses: vagov-cypress-integration-tests/.github/workflows/cypress-integration-test-workflow.yml@main
secrets: inherit
notify-failure:
name: Notify Failure
runs-on: ubuntu-latest
if: ${{ failure() || cancelled() }}
needs: call-integration-test-workflow
steps:
- name: Checkout
uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
- name: Notify Slack
uses: ./.github/workflows/slack-notify
continue-on-error: true
with:
payload: '{"attachments": [{"color": "#FF0800","blocks": [{"type": "section","text": {"type": "mrkdwn","text": "vets-website manual dev/staging deploy failed!: <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}>"}}]}]}'
channel_id: ${{ env.VETS_WEBSITE_CHANNEL_ID }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}