-
Notifications
You must be signed in to change notification settings - Fork 45
131 lines (120 loc) · 5.4 KB
/
nightly.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: "Nightly Tests"
env:
CACHE_NAME: marlowe-temp
ALLOWED_URIS: "https://github.com https://api.github.com"
TRUSTED_PUBLIC_KEYS: "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= marlowe-temp.cachix.org-1:1gPjVFpu4QjaAT3tRurCioX+BC23V7mjvFwpP5bV0Ec= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk="
SUBSTITUTERS: "https://cache.nixos.org/ https://cache.iog.io https://marlowe-temp.cachix.org https://cache.zw3rk.com/"
on:
schedule:
# Run at 00:00 UTC every day
- cron: 0 0 * * *
# Allow running manually
workflow_dispatch:
jobs:
check-deploy:
# Disable this job for now, we need to get automatic deploys working again and
# make the version of the latest deploy inspectable.
# Reenable the dependency of the other jobs on this one when enabled
if: false
runs-on: ubuntu-latest
steps:
- name: Check deploy
run: |
CURRENT_DEPLOY=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/input-output-hk/marlowe-cardano/actions/workflows/deploy.yml/runs\?per_page\=1\&branch\=main\&status\=success | jq --raw-output '.workflow_runs[0].head_sha')
if [ $CURRENT_DEPLOY != $GITHUB_SHA ];
then
echo "Unable to run nightly tests on $GITHUB_SHA, currently deployed commit is $CURRENT_DEPLOY"
exit 1
fi
marlowe-finder:
runs-on: ubuntu-latest
# Dependency disabled pending automatic deploys
# needs: [check-deploy]
env:
ENVIRONMENT: preprod
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v21
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://releases.nixos.org/nix/nix-2.10.3/install
extra_nix_config: |
allowed-uris = ${{ env.ALLOWED_URIS }}
trusted-public-keys = ${{ env.TRUSTED_PUBLIC_KEYS }}
substituters = ${{ env.SUBSTITUTERS }}
experimental-features = nix-command flakes
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: ${{ env.CACHE_NAME }}
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Run Marlowe Finder on Preprod
run: |
nix run .#marlowe-finder -- \
--marlowe-runtime-host marlowe-runtime-preprod.scdev.aws.iohkdev.io \
--end-at-tip
marlowe-scaling:
runs-on: ubuntu-latest
# Dependency disabled pending automatic deploys
# needs: [check-deploy]
env:
ENVIRONMENT: preview
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v21
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://releases.nixos.org/nix/nix-2.10.3/install
extra_nix_config: |
allowed-uris = ${{ env.ALLOWED_URIS }}
trusted-public-keys = ${{ env.TRUSTED_PUBLIC_KEYS }}
substituters = ${{ env.SUBSTITUTERS }}
experimental-features = nix-command flakes
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: ${{ env.CACHE_NAME }}
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Copy Signing Keys
env:
TEST_WALLET_SIGNING_KEYS: ${{ secrets.TEST_WALLET_SIGNING_KEYS }}
run: |
i=0
while IFS= read -r key
do
echo $key | jq . > test-wallets/test.$i.skey
i=$((i+1))
done < <(printf '%s\n' "$TEST_WALLET_SIGNING_KEYS")
- name: Run Marlowe Scaling on Preview
run: |
nix run .#marlowe-scaling -- \
--marlowe-runtime-host marlowe-runtime-preview.scdev.aws.iohkdev.io \
2 \
"$(cat test-wallets/test.0.addr)=test-wallets/test.0.skey" \
"$(cat test-wallets/test.1.addr)=test-wallets/test.1.skey" \
"$(cat test-wallets/test.2.addr)=test-wallets/test.2.skey" \
"$(cat test-wallets/test.3.addr)=test-wallets/test.3.skey" \
"$(cat test-wallets/test.4.addr)=test-wallets/test.4.skey" \
"$(cat test-wallets/test.5.addr)=test-wallets/test.5.skey" \
"$(cat test-wallets/test.6.addr)=test-wallets/test.6.skey" \
"$(cat test-wallets/test.7.addr)=test-wallets/test.7.skey" \
"$(cat test-wallets/test.8.addr)=test-wallets/test.8.skey" \
"$(cat test-wallets/test.9.addr)=test-wallets/test.9.skey" \
"$(cat test-wallets/test.10.addr)=test-wallets/test.10.skey" \
"$(cat test-wallets/test.11.addr)=test-wallets/test.11.skey" \
"$(cat test-wallets/test.12.addr)=test-wallets/test.12.skey" \
"$(cat test-wallets/test.13.addr)=test-wallets/test.13.skey" \
"$(cat test-wallets/test.14.addr)=test-wallets/test.14.skey" \
"$(cat test-wallets/test.15.addr)=test-wallets/test.15.skey" \
"$(cat test-wallets/test.16.addr)=test-wallets/test.16.skey" \
"$(cat test-wallets/test.17.addr)=test-wallets/test.17.skey" \
"$(cat test-wallets/test.18.addr)=test-wallets/test.18.skey" \
"$(cat test-wallets/test.19.addr)=test-wallets/test.19.skey"