Merge pull request #206 from t1m0t/master

Improve test speed in the CI
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2022-02-04 13:37:42 -05:00
commit 8e2a95ed74
5 files changed
+37 -21

No files matched your search

+13 -2
View File
@@ -1,9 +1,20 @@
FROM rust:1.58-buster FROM rust:1.58-buster
RUN apt update RUN apt update
RUN apt install -y libglib2.0-dev libgtk-3-dev libsoup2.4-dev libappindicator3-dev libwebkit2gtk-4.0-dev firefox-esr RUN apt install -y \
libglib2.0-dev \
libgtk-3-dev \
libsoup2.4-dev \
libappindicator3-dev \
libwebkit2gtk-4.0-dev \
firefox-esr
# for kcov and Tarpaulin
#liblzma-dev binutils-dev libcurl4-openssl-dev libdw-dev libelf-dev
RUN cargo install cargo-make --debug RUN cargo install cargo-make --debug
# for test coverage
#RUN cargo install cargo-tarpaulin
# clean up a bit
RUN cargo install cargo-cache && cargo cache -a RUN cargo install cargo-cache && cargo cache -a
CMD ["echo","\"base image built\""] CMD ["exit"]
+2 -3
View File
@@ -25,14 +25,13 @@ function run_script {
then then
docker image rm dioxus-base-test-image docker image rm dioxus-base-test-image
docker image rm dioxus-test-image docker image rm dioxus-test-image
docker system prune -af
fi fi
fi fi
} }
run_script || echo "Error occured.. cleaning a bit." && \ run_script || echo "Error occured.. cleaning a bit." && \
docker system prune -af; docker system prune -f;
docker system prune -af docker system prune -f
echo "Script finished to execute" echo "Script finished to execute"
+2 -5
View File
@@ -33,12 +33,9 @@ jobs:
- uses: Swatinem/rust-cache@v1 - uses: Swatinem/rust-cache@v1
- run: sudo apt-get update - run: sudo apt-get update
- run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev - run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
- name: Install cargo-make - uses: davidB/rust-cargo-make@v1
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- uses: browser-actions/setup-firefox@latest - uses: browser-actions/setup-firefox@latest
- uses: jetli/wasm-pack-action@v0.3.0
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: make command: make
+18 -9
View File
@@ -10,13 +10,6 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
namespace = "core" namespace = "core"
private = true private = true
[tasks.tests]
category = "Testing"
dependencies = ["tests-setup"]
description = "Run all tests"
env = {CARGO_MAKE_WORKSPACE_SKIP_MEMBERS = ["**/examples/*", "**/packages/changelog"]}
run_task = {name = ["test-flow"], fork = true}
[tasks.tests-setup] [tasks.tests-setup]
private = true private = true
script = [ script = [
@@ -31,12 +24,28 @@ script = [
] ]
script_runner = "@duckscript" script_runner = "@duckscript"
[tasks.tests]
category = "Testing"
dependencies = ["tests-setup"]
description = "Run all tests"
env = {CARGO_MAKE_WORKSPACE_SKIP_MEMBERS = ["**/examples/*"]}
run_task = {name = ["test-flow", "test-with-browser"], fork = true}
[tasks.build]
command = "cargo"
args = ["build"]
[tasks.test-flow] [tasks.test-flow]
dependencies = ["test"] dependencies = ["test"]
private = true private = true
workspace = true
[tasks.test] [tasks.test]
args = ["test", "--all-targets", "--workspace", "--exclude", "dioxus-mobile"] dependencies = ["build"]
command = "cargo" command = "cargo"
args = ["test", "--all-targets", "--workspace", "--exclude", "dioxus-router"]
private = true private = true
[tasks.test-with-browser]
env = { CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS = ["**/packages/router"] }
private = true
workspace = true
+2 -2
View File
@@ -1,4 +1,4 @@
[tasks.test] [tasks.test-with-browser]
extend = "core::wasm-pack-base" extend = "core::wasm-pack-base"
command = "wasm-pack" command = "wasm-pack"
args = [ args = [
@@ -7,4 +7,4 @@ args = [
"--", "--",
"--features", "--features",
"${DIOXUS_TEST_FEATURES}", "${DIOXUS_TEST_FEATURES}",
] ]