-
Notifications
You must be signed in to change notification settings - Fork 7
120 lines (120 loc) · 3.85 KB
/
run.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
name: Run non-interactive demo
on:
push:
branches:
- main
pull_request:
env:
GH_TOKEN: ${{ github.token }}
jobs:
# readme:
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ macos-14, ubuntu-22.04 ]
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Run the README code parts
# run: bin/test-readme
demo_current:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14, ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Add user path
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$PWD/bin" >> $GITHUB_PATH
- name: Unbork mac
if: matrix.os == 'macos-14'
run: |
brew install bash
echo "/usr/local/bin" >> $GITHUB_PATH
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
- name: Install dfx
uses: dfinity/setup-dfx@main
- name: Install dependencies
run: ./bin/dfx-sns-demo-install --verbose
- name: Run the demo with the current default ic commits
run: bin/dfx-sns-demo --config_index 0
- name: Create and finalize an additional SNS
run: |
./bin/dfx-sns-demo-mksns --config_index 1
./bin/dfx-sns-sale-buy
./bin/dfx-sns-sale-finalize
- name: Create lots of SNS
if: matrix.os != 'macos-14'
run: |
./bin/dfx-sns-demo-mksns-parallel -s 10 --config_index_offset 2 -m snsdemo8
- name: Save state
if: matrix.os != 'macos-14'
run: |
# Stop the replica to let it persist all its state before we save the state.
dfx stop
echo "Waiting for replica to stop"
for (( i=100; i>0; i-- )); do
echo "$i"
pgrep replica || break
sleep 1
done
echo "Making sure the replica is dead"
./bin/dfx-network-stop
sleep 1
echo "Saving state"
bin/dfx-snapshot-save --verbose --snapshot state.tar.xz
- name: Upload state
if: matrix.os != 'macos-14'
uses: actions/upload-artifact@v3
with:
name: snsdemo
path: state.tar.xz
retention-days: 3
demo_latest:
if: true # Claim that snsdemo works with the latest IC repo commit (true) or acknowledge that it doesn't (false).
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14, ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Add user path
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$PWD/bin" >> $GITHUB_PATH
- name: Unbork mac
if: matrix.os == 'macos-14'
run: |
brew install bash
echo "/usr/local/bin" >> $GITHUB_PATH
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
- name: Install dfx
uses: dfinity/setup-dfx@main
- name: Install dependencies
run: ./bin/dfx-sns-demo-install --verbose
# Clone the ic repo so that we can find the latest published commit.
- name: Checkout ic repo
uses: actions/checkout@v3
with:
repository: dfinity/ic
ref: master
fetch-depth: 100
path: ic
- name: Run the demo with the latest repo
run: bin/dfx-sns-demo --ic_commit latest --ic_dir ic --config_index 0
- name: Create and finalize an additional SNS
run: |
./bin/dfx-sns-demo-mksns --config_index 1
./bin/dfx-sns-sale-buy
./bin/dfx-sns-sale-finalize
- name: Create lots of SNS
if: matrix.os != 'macos-14'
run: |
./bin/dfx-sns-demo-mksns-parallel -s 10 --config_index_offset 2 -m snsdemo8