-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.17 KB
/
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
name: IntegrationTest
on:
workflow_call:
inputs:
node-version:
default: "16"
required: false
type: string
secrets:
discord_token:
required: true
jobs:
test:
runs-on: ubuntu-latest
env:
# These aren't actually secret, they're just for testing purposes.
PUBLIC_KEY: a58293d7fa04d53ab90108be275a87fe890eece595962273a93e1f87d398df74
CYPRESS_PRIVATE_KEY: 814d1a8737ba28a2ae72e39cac46468002525a64e4f002d7b52dd06efb9dc4b8a58293d7fa04d53ab90108be275a87fe890eece595962273a93e1f87d398df74
CYPRESS_MAP_BUCKET: carto-bot-maps
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
- name: Set up Node.JS
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: npm
- name: Install Node dependencies
run: npm ci
- name: Download packages
uses: actions/download-artifact@v3
with:
name: packages
path: packages
- name: Start Localstack
working-directory: packages/integration
run: docker-compose up -d
- name: Build test environment
working-directory: packages/terraform/localstack
run: |
terraform init
terraform apply \
-var="discord_public_key=${{ env.PUBLIC_KEY }}" \
-var="discord_token=${{ secrets.discord_token }}" \
-var="discord_base_url=http://172.17.0.1:3000" \
-auto-approve
- name: Run tests
uses: cypress-io/github-action@v4
with:
build: npm run setup -w @carto/integration
start: npm start -w @carto/mock-discord
project: packages/integration
- name: Upload screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-snapshots
path: packages/integration/cypress/screenshots
- name: Print docker-compose logs
if: failure()
working-directory: packages/integration
run: docker-compose logs
- name: Stop Localstack
working-directory: packages/integration
run: docker-compose down