-
Notifications
You must be signed in to change notification settings - Fork 7
205 lines (187 loc) · 7.73 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Nightly checks
on:
schedule:
- cron: "0 0 * * *" # every day at midnight
workflow_dispatch:
env:
BINARY_LIST_FILE: "./binary-build-list.json"
CARGO_TERM_COLOR: always
# Disable incremental compilation.
#
# Incremental compilation is useful as part of an edit-build-test-edit cycle,
# as it lets the compiler avoid recompiling code that hasn't changed. However,
# on CI, we're not making small edits; we're almost always building the entire
# project from scratch. Thus, incremental compilation on CI actually
# introduces *additional* overhead to support making future builds
# faster...but no future builds will ever occur in any given CI environment.
#
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
# for details.
CARGO_INCREMENTAL: 0
# Allow more retries for network requests in cargo (downloading crates) and
# rustup (installing toolchains). This should help to reduce flaky CI failures
# from transient network timeouts or other issues.
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
# Don't emit giant backtraces in the CI logs.
RUST_BACKTRACE: short
jobs:
release:
name: build release binaries
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
self-hosted, # ubuntu-x86_64
macos-latest, # macos-arm64
]
steps:
# TODO: Remove when iota-sim is public https://github.com/iotaledger/iota/issues/2149
- name: Set up SSH (MacOs only)
if: ${{ matrix.os == 'macos-latest' }}
uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # pin@v3
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
private-key-name: github-ppk
- name: Install postgres (MacOS arm64)
if: ${{ matrix.os == 'macos-latest' }}
shell: bash
env:
PQ_LIB_DIR: "$(brew --prefix libpq)/lib"
LIBRARY_PATH: "/opt/homebrew/lib:$LIBRARY_PATH"
PKG_CONFIG_PATH: "/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"
PATH: "/opt/homebrew/bin:$PATH"
run: |
brew install postgresql
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- name: cargo build
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # [email protected]
with:
command: build
args: --all-targets --all-features --release
test:
name: Test rust crates
env:
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var
# causes #[sim_test] to only run under the deterministic `simtest` job, and not the
# non-deterministic `test` job.
IOTA_SKIP_SIMTESTS: 1
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2
with:
tool: nextest
- name: cargo test
run: cargo nextest run --profile ci
test-extra:
env:
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var
# causes #[sim_test] to only run under the deterministic `simtest` job, and not the
# non-deterministic `test` job.
IOTA_SKIP_SIMTESTS: 1
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # Pin v4
- uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2
with:
tool: nextest
- name: benchmark (smoke)
run: |
cargo run --package iota-benchmark --bin stress -- --log-path /tmp/stress.log --num-client-threads 10 --num-server-threads 24 --num-transfer-accounts 2 bench --target-qps 100 --num-workers 10 --transfer-object 50 --shared-counter 50 --run-duration 10s --stress-stat-collection
- name: doctests
run: |
cargo test --doc
- name: rustdoc
run: |
cargo doc --all-features --workspace --no-deps
- name: Install cargo-hakari, and cache the binary
uses: baptiste0928/cargo-install@904927dbe77864e0f2281519fe9d5bd097a220b3 # pin@v3
with:
crate: cargo-hakari
locked: true
- name: Install nightly rustfmt
run: rustup toolchain install nightly --component rustfmt --allow-downgrade
- name: iota-execution
run: |
./scripts/execution_layer.py generate-lib
# Ensure there are no uncommitted changes in the repo after running tests
- run: scripts/changed-files.sh
shell: bash
simtest:
name: Simtest rust
timeout-minutes: 45
runs-on: [self-hosted]
env:
MSIM_WATCHDOG_TIMEOUT_MS: 60000
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2
with:
tool: nextest
- run: scripts/simtest/cargo-simtest simtest --profile ci
- name: check new tests for flakiness
run: |
command="scripts/simtest/stress-new-tests.sh $filters"
echo "$command"
eval ${command}
graphql-rpc:
name: graphql-rpc
timeout-minutes: 45
runs-on: [self-hosted]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespw
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgrespw
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name postgres_container
ports:
- 5432:5432
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2
with:
tool: nextest
- name: Install postgresql-client
run: sudo apt-get install -y postgresql-client
- name: Setup db
run: |
PGPASSWORD=$POSTGRES_PASSWORD psql -h localhost -U $POSTGRES_USER -c 'CREATE DATABASE iota_indexer;' -c 'ALTER SYSTEM SET max_connections = 500;'
- run: docker restart --time 0 postgres_container
- run: sleep 5
- name: tests-requiring-postgres
run: |
cargo nextest run --no-fail-fast --test-threads 1 --package iota-graphql-rpc --test e2e_tests --test examples_validation_tests --features pg_integration
cargo nextest run --no-fail-fast --test-threads 1 --package iota-graphql-rpc --lib --features pg_integration -- test_query_cost
cargo nextest run --no-fail-fast --test-threads 8 --package iota-graphql-e2e-tests --features pg_integration
cargo nextest run --no-fail-fast --test-threads 1 --package iota-cluster-test --test local_cluster_test --features pg_integration
cargo nextest run --no-fail-fast --test-threads 1 --package iota-indexer --test ingestion_tests --features pg_integration
# Iota-indexer's RPC tests, which depend on a shared runtime, are incompatible with nextest due to its process-per-test execution model.
# cargo test, on the other hand, allows tests to share state and resources by default.
cargo test --profile simulator --package iota-indexer --test rpc-tests --features shared_test_runtime
move-tests:
uses: ./.github/workflows/_move_tests.yml
deny:
uses: ./.github/workflows/_cargo_deny.yml
deny-external:
uses: ./.github/workflows/_cargo_deny.yml
with:
manifest-path: external-crates/move/Cargo.toml
e2e:
uses: ./.github/workflows/_e2e.yml
execution-cut:
uses: ./.github/workflows/_execution_cut.yml
split-cluster:
uses: ./.github/workflows/split_cluster.yml