@@ -177,15 +177,6 @@ workflows:
177177 with :
178178 components : rustfmt
179179
180- - name : " Cache Cargo intermediate products"
181- uses : actions/cache@v3
182- with :
183- path : |-
184- ~/.cargo/registry
185- ~/.cargo/git
186- ui/target
187- key : ${{ runner.os }}-cargo-${{ hashFiles('ui/**/Cargo.lock') }}-2
188-
189180 - name : " Format server"
190181 run : cargo fmt --manifest-path ui/Cargo.toml --all --check
191182
@@ -196,50 +187,16 @@ workflows:
196187 run : cargo fmt --manifest-path compiler/base/orchestrator/Cargo.toml --check
197188
198189 - name : " Build backend"
199- run : >-
200- mkdir -p ui/target;
201- docker
202- run
203- --rm
204- -v $PWD/compiler/base/asm-cleanup:/compiler/base/asm-cleanup
205- -v $PWD/compiler/base/orchestrator:/compiler/base/orchestrator
206- -v $PWD/compiler/base/modify-cargo-toml:/compiler/base/modify-cargo-toml
207- -v $PWD/ui:/ui
208- -v ~/.cargo/git:/root/.cargo/git
209- -v ~/.cargo/registry:/root/.cargo/registry
210- --workdir /ui
211- rust:alpine
212- sh -c '
213- apk add musl-dev openssl-dev openssl-libs-static
214-
215- # Adding -C relocation-model=static due to
216- # https://github.com/rust-lang/rust/issues/95926
217-
218- # Adding this to find the statically-built version
219- export OPENSSL_NO_PKG_CONFIG=1 OPENSSL_STATIC=1 OPENSSL_DIR=/usr/
220-
221- # Unit tests
222- cargo rustc --tests --locked -- -C relocation-model=static;
223-
224- test_bin=$(find target/debug/deps/ -name "ui*" -type f -perm -a=x);
225- mv "${test_bin}" target/unit_tests;
226-
227- # Primary binary
228- cargo rustc --locked --release -- -C relocation-model=static;
229- mv target/release/ui target/ui;
230- '
231-
232- - name : " Restore permissions"
233- run : >-
234- sudo chown -R runner:docker ~/.cargo/ ui/target
190+ run : ./ci/build-backend.sh
235191
236192 - name : " Save backend artifact"
237193 uses : actions/upload-artifact@v3
238194 with :
239195 name : backend
240196 path : |
241- ui/target/ui
242- ui/target/unit_tests
197+ docker-output/ui
198+ docker-output/unit_tests_ui
199+ docker-output/unit_tests_orchestrator
243200
244201 build_frontend :
245202 name : " Build frontend"
@@ -354,9 +311,16 @@ workflows:
354311 name : frontend
355312 path : tests/server/build/
356313
357- - name : " Run unit tests"
314+ - name : " Run orchestrator unit tests"
315+ env :
316+ TESTS_MAX_CONCURRENCY : 3
317+ TESTS_TIMEOUT_MS : 30000
318+ run : |-
319+ chmod +x ./server/unit_tests_orchestrator && ./server/unit_tests_orchestrator
320+
321+ - name : " Run ui unit tests"
358322 run : |-
359- chmod +x ./server/unit_tests && ./server/unit_tests
323+ chmod +x ./server/unit_tests_ui && ./server/unit_tests_ui
360324
361325 - name : " Run tests"
362326 env :
0 commit comments