-
Notifications
You must be signed in to change notification settings - Fork 213
134 lines (112 loc) · 3.98 KB
/
e2e-docker.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
132
133
134
name: E2E Docker
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
inputs:
nodeTag:
description: 'Node docker-image tag to use'
required: true
default: '8.9.1'
walletTag:
description: 'Wallet docker-image tag to use'
required: true
default: 'rc-latest'
tags:
description: 'Test tags (all, light, offchain...)'
default: 'all'
branch:
description: 'Clone E2E tests from branch'
default: 'rc-latest'
defaults:
run:
working-directory: ./test/e2e
jobs:
test:
runs-on: ubuntu-latest
env:
TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }}
BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }}
WALLET: ${{ github.event.inputs.walletTag || 'rc-latest' }}
NODE: ${{ github.event.inputs.nodeTag || '8.9.1' }}
TESTS_E2E_TOKEN_METADATA: https://metadata.world.dev.cardano.org/
TAGS: ${{ github.event.inputs.tags || 'all' }}
E2E_DOCKER_RUN: 1
steps:
- name: Checkout the rc-latest tag
uses: actions/checkout@v4.1.1
with:
ref: ${{ github.event.inputs.branch || 'rc-latest' }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: ⚙️ Setup (get latest bins and configs and decode fixtures)
run: rake setup[preprod,${{ env.WALLET}}]
- name: 💾 Cache node db
id: cache-node
uses: actions/cache@v3
with:
path: test/e2e/state/node_db/preprod
key: node-db-docker-linux-preprod
- name: Fetch preprod snapshot
if: steps.cache-node.outputs.cache-hit != 'true'
run: |
../../scripts/gh/fetch-preprod-snapshot.sh
- name: 🚀 Start node and wallet
run: |
echo "Wallet image tag: ${{ env.WALLET }}"
echo "Node image tag: ${{ env.NODE }}"
echo "Metadata server: ${{ env.TESTS_E2E_TOKEN_METADATA }}"
NODE_CONFIG_PATH=`pwd`/state/configs/preprod \
DATA=`pwd`/state/node_db/preprod \
WALLET_DATA=`pwd`/state/wallet_db/preprod \
docker-compose -f docker-compose-test.yml up --detach
- name: 🔍 Display versions
run: |
docker run --rm cardanofoundation/cardano-wallet:$WALLET version
docker run --rm ghcr.io/intersectmbo/cardano-node:${{ env.NODE }} cli version
- name: ⏳ Wait until node is synced
run: rake wait_until_node_synced
- name: 🧪 Run all tests
run: rake spec SPEC_OPTS="-t $TAGS"
- name: 📖 Get docker logs
if: always()
run: rake get_docker_logs
- name: 📎 Upload logs
uses: actions/upload-artifact@v3
if: always()
with:
name: linux-docker-logs
path: test/e2e/state/logs
- name: Stop docker-compose
run: NODE_CONFIG_PATH=`pwd`/state/configs/preprod docker-compose -f docker-compose-test.yml down
- name: 💾 GH Save Cache of node db
if: always()
uses: actions/cache/save@v3
with:
path: test/e2e/state/node_db/preprod
key: node-db-docker-linux-preprod
- name: Slack Notification on failure
if: failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_ICON_EMOJI: ':poop:'
SLACK_USERNAME: 'GitHub Action'
SLACK_MESSAGE: |
*Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
SLACK_COLOR: '#FF0000'
- name: Slack Notification on success
if: success()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_ICON_EMOJI: ':rocket:'
SLACK_USERNAME: 'GitHub Action'
SLACK_MESSAGE: |
*Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
SLACK_COLOR: '#00FF00'