-
Notifications
You must be signed in to change notification settings - Fork 117
139 lines (133 loc) · 5.66 KB
/
main.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
name: Node.js CI
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
lint-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node:
- 'lts/gallium'
- 'lts/hydrogen'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run build-docs
- run: npm run test -- --runInBand
- name: Codecov
uses: codecov/[email protected]
with:
file: .coverage/*.json
env:
CI: true
RUN_INTEGRATION: true
integration-tests-testnet:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- testnet: nairobinet
testnet_uppercase: NAIROBINET
- testnet: oxfordnet
testnet_uppercase: OXFORDNET
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/gallium
- run: npm ci
- run: npm run build
- if: ${{ !github.event.pull_request.head.repo.fork }}
name: Tailscale
uses: tailscale/github-action@v1
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
version: 1.32.2
- run: npm -w integration-tests run test:${{ matrix.testnet }} -- --maxWorkers=4
env:
# Ternary operator workaround
TEZOS_RPC_${{ matrix.testnet_uppercase }}: ${{ github.event.pull_request.head.repo.fork && format('https://{0}.ecadinfra.com', matrix.testnet) || null }}
integration-tests-flextesa:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- protocol: Nairobi
testnet: nairobinet
testnet_uppercase: NAIROBINET
flextesa_docker_image: oxheadalpha/flextesa:20230607
- protocol: Oxford
testnet: oxfordnet
testnet_uppercase: OXFORDNET
flextesa_docker_image: oxheadalpha/flextesa:latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/gallium
## The 4 Bootstrap Accounts (alias, pk, pkh, sk)
# alice,edpkvGfYw3LyB1UcCahKQk4rF2tvbMUk8GFiTuMjL75uGXrpvKXhjn,tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb,unencrypted:edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq
# bob,edpkurPsQ8eUApnLUJ9ZPDvu98E8VNj4KtJa1aZr16Cr5ow5VHKnz4,tz1aSkwEot3L2kmUvcoxzjMomb9mvBNuzFK6,unencrypted:edsk3RFfvaFaxbHx8BMtEW1rKQcPtDML3LXjNqMNLCzC3wLC1bWbAt
# charlie,edpkuvMuRuZ6ZbAquJH1XxBFfUmuBFz1zp9ENEqjCVgLp3NcY3Ww9M,tz1RDVcKmFcqzvTpJirvg4JaUVgZbjtnRT26,unencrypted:edsk3RgWvbKKA1atEUcaGwivge7QtckHkTL9nQJUXQKY5r8WKp4pF4
# donald,edpkvXGp1BMZxHkwg3mKnWfJYS6HTJ5JtufD8YXxLtH8UKqLZkZVun,tz1eSWp4B9s1qhtNMMNXAkaf2oqCnDHd2iAm,unencrypted:edsk3S8mG2sSBmSRbikAcZVLCz4SrCq4DjmsQRic6MGktqNFijfrS2
- name: Generate Flextesa bootstrap accounts
run: |-
echo "alice=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key alice)" >> $GITHUB_ENV
echo "bob=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key bob)" >> $GITHUB_ENV
echo "charlie=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key charlie)" >> $GITHUB_ENV
echo "donald=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key donald)" >> $GITHUB_ENV
- name: Provision Flextesa ${{ matrix.protocol }} container
run: |-
docker run \
--pull always \
--rm \
--name my-sandbox \
--detach \
-p 20000:20000 \
${{ matrix.flextesa_docker_image }} \
flextesa mini-net \
--root /tmp/mini-box --size 1 \
--set-history-mode N000:archive \
--number-of-b 1 \
--balance-of-bootstrap-accounts tez:100_000_000 \
--time-b 1 \
--add-bootstrap-account="${alice}@2_000_000_000_000" \
--add-bootstrap-account="${bob}@2_000_000_000_000" \
--add-bootstrap-account="${charlie}@2_000_000_000_000" \
--add-bootstrap-account="${donald}@2_000_000_000_000" \
--no-daemons-for=donald \
--until-level 200_000_000 \
--protocol-kind ${{ matrix.protocol }} \
${{ matrix.protocol == 'Oxford' && '--adaptive-issuance-vote "on"' || '' }}
- run: npm ci
- run: npm run build
- run: npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:${{ matrix.testnet }}-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts sandbox-ballot-operation.spec.ts
env:
RUN_${{ matrix.testnet_uppercase }}_WITH_SECRET_KEY: true
SECRET_KEY: edsk3S8mG2sSBmSRbikAcZVLCz4SrCq4DjmsQRic6MGktqNFijfrS2
TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://localhost:20000
POLLING_INTERVAL_MILLISECONDS: 100
RPC_CACHE_MILLISECONDS: 0
TEZOS_BAKER: tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
- run: npm -w integration-tests run test:${{ matrix.testnet }}-secret-key sandbox-ballot-operation.spec.ts
env:
RUN_${{ matrix.testnet_uppercase }}_WITH_SECRET_KEY: true
SECRET_KEY: edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq
TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://localhost:20000
POLLING_INTERVAL_MILLISECONDS: 100
RPC_CACHE_MILLISECONDS: 0
TEZOS_BAKER: tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb