forked from oasisprotocol/amber-network-entities
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (66 loc) · 3.5 KB
/
validate-files.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
name: Validate Entity Packages
on: [push, pull_request]
jobs:
validate_entity_packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Python 3
uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/setup-go@v1
with:
go-version: '1.13.x'
- run: cd go/genesis-tools && go build . && cp genesis-tools /tmp/genesis-tools
- run: pip3 install -r .github/scripts/python/requirements.txt
- name: Validate entity packages
run: mkdir /tmp/unpack && python3 .github/scripts/python/unpack_entities.py ./entities /tmp/unpack
- name: Generate a pre-production staking genesis
run: >-
/tmp/genesis-tools staking_genesis
--staking.entities_dir /tmp/unpack
--staking.params .github/pre_prod_staking_params.json
--log.level debug
--staking.default_self_escrow 10000
--output-path /tmp/staking.pre_prod.json
#- name: Download oasis-node
# run: curl -Lo /tmp/oasis-node.tar.gz https://github.com/oasislabs/oasis-core/releases/download/v20.3.2/oasis_core_linux_amd64.tar.gz
#- name: Unpack oasis-node
# run: cd /tmp && tar xvf oasis_core_linux_amd64.tar.gz && chmod +x /tmp/oasis-node
# Temporarily use a local oasis-node release
- name: Download oasis-node
run: curl -Lo /tmp/oasis-node https://buildkite.com/organizations/oasisprotocol/pipelines/oasis-core-ci/builds/217/jobs/16a0c50e-e8cb-41b8-ac63-c84b19649315/artifacts/a584b74e-0f29-4a91-a364-b5cabebf691d
- name: make oasis-node executable
run: chmod +x /tmp/oasis-node
- name: Generate a "pre-production" genesis document
run: GENESIS_OUTPUT_PATH=/tmp/genesis.pre_prod.json STAKING_GENESIS_PATH=/tmp/staking.pre_prod.json python3 .github/scripts/python/generate_genesis.py /tmp/unpack
- name: Sanity check genesis file
run: /tmp/oasis-node genesis check --genesis.file /tmp/genesis.pre_prod.json
- name: Upload the "pre-production" genesis document
uses: actions/upload-artifact@v1
with:
name: genesis.pre_prod.json
path: /tmp/genesis.pre_prod.json
- name: Validate test only entity packages
run: mkdir /tmp/test_only_unpack && python3 .github/scripts/python/unpack_entities.py ./test_only_entities /tmp/test_only_unpack
- name: Generate a test only staking genesis
run: >-
/tmp/genesis-tools staking_genesis
--staking.entities_dir /tmp/unpack
--staking.entities_dir /tmp/test_only_unpack
--staking.params .github/test_only_staking_params.json
--log.level debug
--staking.default_self_escrow 10000
--output-path /tmp/staking.test_only.json
- name: Generate a test only genesis document
run: GENESIS_OUTPUT_PATH=/tmp/genesis.test_only.json STAKING_GENESIS_PATH=/tmp/staking.test_only.json OASIS_TEST_ONLY=true python3 .github/scripts/python/generate_genesis.py /tmp/unpack /tmp/test_only_unpack
- name: Dry run the genesis file
run: python3 .github/scripts/python/oasis_node_dry_run.py /tmp/oasis-node /tmp/genesis.test_only.json
- name: Sanity check genesis file
run: /tmp/oasis-node genesis check --genesis.file /tmp/genesis.test_only.json
- name: Upload the "test_only" genesis document
uses: actions/upload-artifact@v1
with:
name: genesis.test_only.json
path: /tmp/genesis.test_only.json