-
Notifications
You must be signed in to change notification settings - Fork 3
131 lines (118 loc) · 4.51 KB
/
e2e_tests.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: E2E tests
on:
push:
branches: [main]
pull_request:
branches: [main]
types:
- labeled
- synchronize
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
network:
description: 'Select the blockchain network for testing'
required: false
default: 'emerynet'
type: choice
options:
- local
- emerynet
- devnet
- xnet
gov1_mnemonic:
description: 'Mnemonic for gov1 wallet'
required: false
type: string
gov2_mnemonic:
description: 'Mnemonic for gov2 wallet'
required: false
type: string
a3p_image_tag:
description: 'Docker image tag for the a3p chain to use in testing'
required: false
type: string
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label ||
github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
e2e:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
env:
NETWORK: >-
${{ inputs.network
|| contains(github.event.pull_request.labels.*.name, 'emerynet') && 'emerynet'
|| contains(github.event.pull_request.labels.*.name, 'devnet') && 'devnet'
|| contains(github.event.pull_request.labels.*.name, 'xnet') && 'xnet'
|| github.event_name == 'schedule' && 'emerynet'
|| 'local'
}}
steps:
- name: Print network name
run: echo "${{ env.NETWORK }}"
- name: Checkout
uses: actions/checkout@v3
- name: 'GCP auth'
uses: 'google-github-actions/auth@v2'
if: ${{ env.NETWORK != 'local' }}
with:
project_id: 'simulationlab'
workload_identity_provider: 'projects/60745596728/locations/global/workloadIdentityPools/github/providers/dapp-econ-gov'
- name: Run e2e tests
run: |
docker compose -f tests/e2e/docker-compose.yml --profile $SYNPRESS_PROFILE up --build --exit-code-from synpress
env:
# conditionals based on github event
SYNPRESS_PROFILE: ${{ env.NETWORK != 'local' && 'daily-tests' || 'synpress' }}
CYPRESS_AGORIC_NET: ${{ env.NETWORK }}
# for docker-compose.yml
A3P_IMAGE_TAG: ${{ inputs.a3p_image_tag || 'latest' }}
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
DOCKER_DEFAULT_PLATFORM: linux/amd64
NGROK_AUTH: ${{ secrets.NGROK_AUTH }}
NGROK_BASIC_AUTH: ${{ secrets.NGROK_BASIC_AUTH }}
CYPRESS_PRIVATE_KEY_WITH_FUNDS: ${{ secrets.CYPRESS_PRIVATE_KEY_WITH_FUNDS }}
ANVIL_FORK_URL: ${{ secrets.ANVIL_FORK_URL }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
GOV1_PHRASE: ${{ inputs.gov1_mnemonic || secrets.GOV1_PHRASE }}
GOV2_PHRASE: ${{ inputs.gov2_mnemonic || secrets.GOV2_PHRASE }}
# cypress dashboard
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha }}
- name: Archive e2e artifacts locally
uses: actions/upload-artifact@v3
if: ${{ env.NETWORK == 'local' && !cancelled()}}
with:
name: e2e-artifacts
path: |
tests/e2e/docker/videos
tests/e2e/docker/screenshots
continue-on-error: true
- name: Archive e2e artifacts to GCS
uses: google-github-actions/upload-cloud-storage@v2
if: ${{ env.NETWORK != 'local' && !cancelled() }}
with:
path: 'tests/e2e/docker'
destination: 'github-artifacts/${{ github.repository }}/${{ github.run_id }}/${{ github.event.repository.updated_at }}'
continue-on-error: true
- name: Log Path to GCS Artifacts
if: ${{ env.NETWORK != 'local' && !cancelled() }}
run: echo "https://console.cloud.google.com/storage/browser/github-artifacts/${{ github.repository }}/${{ github.run_id }}/${{ github.event.repository.updated_at }}/docker/videos"
- name: Notify About Failure
if: >
failure() && github.event_name != 'pull_request' &&
github.repository_owner == 'agoric'
uses: ./.github/actions/notify-status
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
continue-on-error: true