-
Notifications
You must be signed in to change notification settings - Fork 214
158 lines (135 loc) · 4.74 KB
/
e2e-windows.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: E2E Windows
on:
push:
tags:
- rc-latest
workflow_dispatch:
inputs:
branch:
description: 'Run tests against branch'
default: 'rc-latest'
tags:
description: 'Test tags (all, light, offchain...)'
default: 'all'
jobs:
test:
concurrency:
group: windows-e2e-group
cancel-in-progress: false
runs-on: windows-latest
env:
NETWORK: preprod
BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }}
TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }}
BRANCH: ${{ github.event.inputs.branch || 'rc-latest' }}
TAGS: ${{ github.event.inputs.tags || 'all' }}
steps:
- name: Check space
run: Get-PSDrive
- name: configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 16GB
maximum-size: 24GB
disk-root: "C:"
- name: Checkout
shell: bash
run: |
git clone -b $BRANCH https://github.com/cardano-foundation/cardano-wallet.git C:/cardano-wallet --depth 1 --no-single-branch
cd /c/cardano-wallet
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.1
bundler-cache: true
working-directory: C:/cardano-wallet/test/e2e
- name: Install dependencies
working-directory: C:/cardano-wallet/test/e2e
run: bundle install
- name: Prepare Windows
run: |
choco install wget
choco install unzip
choco install nssm
choco install archiver
- name: 🕒 Get Date/Time
working-directory: C:/cardano-wallet/test/e2e
run: bundle exec rake datetime
- name: 💾 GH Cache node db
id: cache-node
uses: actions/cache@v3
with:
path: C:/cardano-wallet/test/e2e/state/node_db/preprod
key: node-db-e2e-windows-preprod
- name: Fetch preprod snapshot
if: steps.cache-node.outputs.cache-hit != 'true'
working-directory: C:/cardano-wallet/test/e2e
run: |
mkdir state -ErrorAction SilentlyContinue
cd state
mkdir node_db
cd node_db
mkdir preprod
cd preprod
curl -s https://downloads.csnapshots.io/testnet/testnet-db-snapshot.json | jq -r .[].file_name > snapshot.json
curl -o snapshot.tar.lz4 https://downloads.csnapshots.io/testnet/$(cat snapshot.json)
arc unarchive snapshot.tar.lz4
mv db/* .
- name: ⚙️ Setup (get latest bins and configs and decode fixtures)
working-directory: C:/cardano-wallet/test/e2e
run: bundle exec rake setup[preprod,%BRANCH%]
- name: 🔍 Display versions
working-directory: C:/cardano-wallet/test/e2e
run: bundle exec rake display_versions
- name: 🚀 Start node and wallet
working-directory: C:/cardano-wallet/test/e2e
run: bundle exec rake start_node_and_wallet[preprod]
- name: ⏳ Wait until node is synced
working-directory: C:/cardano-wallet/test/e2e
run: bundle exec rake wait_until_node_synced
- name: 🧪 Run all tests
working-directory: C:/cardano-wallet/test/e2e
run: bundle exec rake spec SPEC_OPTS="-t %TAGS%"
- name: 🏁 Stop node and wallet
working-directory: C:/cardano-wallet/test/e2e
run: bundle exec rake stop_node_and_wallet[preprod]
- name: 💾 GH Save Cache of node db
if: always()
uses: actions/cache/save@v3
with:
path: C:/cardano-wallet/test/e2e/state/node_db/preprod
key: node-db-e2e-windows-preprod
- name: 📎 Upload state
uses: actions/upload-artifact@v3
if: always()
with:
name: windows-state
path: |
C:/cardano-wallet/test/e2e/state/logs
C:/cardano-wallet/test/e2e/state/configs
C:/cardano-wallet/test/e2e/state/wallet_db
report:
needs: [test]
if: always()
runs-on: ubuntu-latest
steps:
- name: Slack Notification on failure
if: needs.test.result != 'success'
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: needs.test.result == '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'