This repository has been archived by the owner on Jun 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
91 lines (71 loc) · 3.72 KB
/
validate-pull-request-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
88
89
90
91
name: Validate Entity Package PR
on: [push, pull_request]
jobs:
validate_package_file_name:
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 the entity package name during a pull request
run: python3 .github/scripts/python/validate_pull_request.py
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: github.event_name == 'pull_request'
- 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.faucet.address ZWVxEX66b1wnY62wx5lp7bR9rF8+2tCxgmcwFs7Kg1s=
--staking.faucet.amount 2000000000
--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
# Temporarily use a local oasis-node release
- name: Download oasis-node
run: curl -Lo /tmp/oasis_core_linux_amd64.tar.gz https://github.com/oasislabs/the-quest-entities/releases/download/DO_NOT_USE/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
- 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.faucet.address uMcicpJEWJxqNSQRTaLeHsQrooxtVXv70sqmYPP2R9s=
--staking.faucet.amount 2000000000
--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: 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