forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (156 loc) · 5.97 KB
/
lint-test.yaml
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
name: "Lint+Test"
on:
pull_request:
push:
branches:
- main
- devnet
- testnet
- auto
- canary
env:
HAS_BUILDPULSE_SECRETS: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID != '' && secrets.BUILDPULSE_SECRET_ACCESS_KEY != '' }}
HAS_DATADOG_SECRETS: ${{ secrets.DD_API_KEY != '' }}
CARGO_INCREMENTAL: "0"
CARGO_TERM_COLOR: always
# cancel redundant builds
concurrency:
# cancel redundant builds on PRs (only on PR, not on branches)
group: ${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.ref) || github.sha }}
cancel-in-progress: true
jobs:
scripts-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt-get install shellcheck --assume-yes --no-install-recommends
- run: shellcheck scripts/dev_setup.sh
terraform-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run terraform fmt, validate, and tflint
run: ./scripts/lint_terraform.sh
ecosystem-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
- uses: pnpm/action-setup@v2
with:
version: 7.14.2
# install packages for examples
- run: cd ./ecosystem/typescript/sdk/examples/typescript && pnpm install
- run: cd ./ecosystem/typescript/sdk/examples/javascript && pnpm install
# Run package build+lint + tests
- run: cd ./ecosystem/typescript/sdk && pnpm install
- run: cd ./ecosystem/typescript/sdk && pnpm lint
- run: cd ./ecosystem/typescript/sdk && pnpm fmt:check
ecosystem-python-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: snok/install-poetry@v1
with:
version: 1.2.2
- run: cd ./ecosystem/python/sdk && poetry install && make fmt && git status --porcelain
docs-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
- uses: pnpm/action-setup@v2
with:
version: 7.14.2
- run: pnpm lint
working-directory: developer-docs-site
- run: sudo apt update -y && sudo apt install -y aspell aspell-en
- run: pnpm spellcheck
working-directory: developer-docs-site
rust-cryptohasher-domain-separation-check:
runs-on: high-perf-docker
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # pin@v3
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984
- uses: ./.github/actions/rust-setup
- run: python3 scripts/check-cryptohasher-symbols.py
rust-lint:
runs-on: high-perf-docker
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rust-setup
with:
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }}
- uses: pre-commit/[email protected]
- run: cargo install cargo-sort
- run: scripts/rust_lint.sh --check
rust-doc-test:
runs-on: high-perf-docker
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # get all the history because cargo xtest --change-since origin/main requires it.
- uses: ./.github/actions/rust-setup
with:
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }}
- run: cargo test --locked --doc --workspace --exclude aptos-node-checker
rust-unit-test:
runs-on: high-perf-docker
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # get all the history because cargo xtest --change-since origin/main requires it.
- uses: ./.github/actions/rust-setup
with:
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }}
- run: docker run --detach -p 5432:5432 cimg/postgres:14.2
- uses: taiki-e/[email protected]
with:
tool: nextest
- run: cargo nextest run --profile ci --locked --workspace --exclude smoke-test --exclude aptos-testcases --retries 3 --no-fail-fast
env:
INDEXER_DATABASE_URL: postgresql://postgres@localhost/postgres
rust-smoke-test:
runs-on: high-perf-docker
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rust-setup
with:
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }}
- run: docker run --detach -p 5432:5432 cimg/postgres:14.2
- uses: taiki-e/[email protected]
with:
tool: nextest
# prebuild aptos-node binary, so that tests don't start before node is built.
# also prebuild aptos-node binary as a separate step to avoid feature unification issues
# --test-threads is intentionally set to reduce resource contention in ci jobs. Increasing this, increases job failures and retries.
- run: cargo build --locked --package=aptos-node --features=failpoints,indexer --release && LOCAL_SWARM_NODE_RELEASE=1 cargo nextest run --release --profile ci --package smoke-test --test-threads 6 --retries 3
env:
INDEXER_DATABASE_URL: postgresql://postgres@localhost/postgres
# We always try to create the artifact, but it only creates on flaky or failed smoke tests -- when the directories are empty.
- name: Upload smoke test logs for failed and flaky tests
uses: actions/upload-artifact@v3
if: ${{ failure() || success() }}
with:
name: failed-smoke-test-logs
# Retain all smoke test data except for the db (which may be large).
path: |
/tmp/.tmp*
!/tmp/.tmp*/**/db/
retention-days: 14
check-vm-features:
runs-on: high-perf-docker
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rust-setup
with:
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }}
- run: cargo test --locked --features check-vm-features -p aptos-node
python-lint-test:
uses: ./.github/workflows/python-lint-test.yaml
helm-lint:
uses: ./.github/workflows/helm-lint.yaml