generated from midnightntwrk/midnight-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 17
193 lines (161 loc) · 6.11 KB
/
ci-cloud.yaml
File metadata and controls
193 lines (161 loc) · 6.11 KB
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
name: ci-cloud
permissions:
contents: read
on:
pull_request:
branches:
- main
- feat/*
- release/*
workflow_dispatch:
concurrency:
group: ${{github.workflow}}-${{github.head_ref || github.run_id}}
cancel-in-progress: true
jobs:
toolchain:
runs-on: ubuntu-latest
outputs:
toolchain: ${{steps.set_toolchain.outputs.toolchain}}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set toolchain
id: set_toolchain
env:
toolchain_toml: "rust-toolchain.toml"
run: |
toolchain=$(grep channel rust-toolchain.toml | sed -r 's/channel = "(.*)"/\1/')
echo "toolchain=$toolchain" | tee -a "$GITHUB_OUTPUT"
check:
runs-on: ubuntu-latest-8-core-x64
needs: toolchain
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{needs.toolchain.outputs.toolchain}}
- name: Install just
uses: taiki-e/install-action@de6bbd1333b8f331563d54a051e542c7dfef81c3 # v2.68.34
with:
tool: just
- name: Setup Rust cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: just check
run: |
APP__INFRA__PUB_SUB__PASSWORD=$(openssl rand -hex 32)
APP__INFRA__SECRET=$(openssl rand -hex 32)
APP__INFRA__STORAGE__PASSWORD=$(openssl rand -hex 32)
export APP__INFRA__PUB_SUB__PASSWORD
export APP__INFRA__SECRET
export APP__INFRA__STORAGE__PASSWORD
git config --global url."https://@github.com".insteadOf "ssh://git@github.com"
rustup override set ${{needs.toolchain.outputs.toolchain}}
just feature=cloud check
fmt-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
components: rustfmt
toolchain: nightly-2026-01-19
- name: Install just
uses: taiki-e/install-action@de6bbd1333b8f331563d54a051e542c7dfef81c3 # v2.68.34
with:
tool: just
- name: Setup Rust cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: just fmt-check
run: |
just feature=cloud fmt-check
lint:
runs-on: ubuntu-latest-8-core-x64
needs: toolchain
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{needs.toolchain.outputs.toolchain}}
components: clippy
- name: Install just
uses: taiki-e/install-action@de6bbd1333b8f331563d54a051e542c7dfef81c3 # v2.68.34
with:
tool: just
- name: Setup Rust cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: just lint
run: |
APP__INFRA__PUB_SUB__PASSWORD=$(openssl rand -hex 32)
APP__INFRA__SECRET=$(openssl rand -hex 32)
APP__INFRA__STORAGE__PASSWORD=$(openssl rand -hex 32)
export APP__INFRA__PUB_SUB__PASSWORD
export APP__INFRA__SECRET
export APP__INFRA__STORAGE__PASSWORD
git config --global url."https://@github.com".insteadOf "ssh://git@github.com"
rustup override set ${{needs.toolchain.outputs.toolchain}}
just feature=cloud lint
test:
runs-on: ubuntu-latest-8-core-x64
needs: toolchain
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Pre-pull Docker images
run: |
NODE_VERSION=$(tail -n 1 NODE_VERSIONS)
echo "Pre-pulling midnight-node:$NODE_VERSION..."
docker pull "midnightntwrk/midnight-node:$NODE_VERSION" || \
docker pull "midnightntwrk/midnight-node:$NODE_VERSION" || \
docker pull "midnightntwrk/midnight-node:$NODE_VERSION"
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{needs.toolchain.outputs.toolchain}}
- name: Install nextest
uses: taiki-e/install-action@de6bbd1333b8f331563d54a051e542c7dfef81c3 # v2.68.34
with:
tool: nextest
- name: Install just
uses: taiki-e/install-action@de6bbd1333b8f331563d54a051e542c7dfef81c3 # v2.68.34
with:
tool: just
- name: Setup Rust cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: just test
run: |
APP__INFRA__PUB_SUB__PASSWORD=$(openssl rand -hex 32)
APP__INFRA__SECRET=$(openssl rand -hex 32)
APP__INFRA__STORAGE__PASSWORD=$(openssl rand -hex 32)
export APP__INFRA__PUB_SUB__PASSWORD
export APP__INFRA__SECRET
export APP__INFRA__STORAGE__PASSWORD
git config --global url."https://@github.com".insteadOf "ssh://git@github.com"
rustup override set ${{needs.toolchain.outputs.toolchain}}
just feature=cloud test
doc:
runs-on: ubuntu-latest-8-core-x64
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
components: rust-docs
toolchain: nightly-2026-01-19
- name: Install just
uses: taiki-e/install-action@de6bbd1333b8f331563d54a051e542c7dfef81c3 # v2.68.34
with:
tool: just
- name: Setup Rust cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: just doc
run: |
git config --global url."https://@github.com".insteadOf "ssh://git@github.com"
just feature=cloud doc