From 606b6cb77c70aedcc7fc7e88563c6b0f70a206eb Mon Sep 17 00:00:00 2001 From: Brady Fomegne Date: Wed, 8 Nov 2023 15:05:21 +0100 Subject: [PATCH] ci: increase coverage --- .github/workflows/coverage.yml | 4 ++-- .github/workflows/rust.yml | 22 ++++++++++----------- .github/workflows/web.yml | 35 ++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + 4 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/web.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index df54321..5ad60f6 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -45,13 +45,13 @@ jobs: - name: build env: RUSTFLAGS: -Cinstrument-coverage - run: cargo build --features inhibit --verbose + run: cargo build -p afrim-memory -p afrim-preprocessor -p afrim-translator -p afrim-config -p afrim --verbose - name: test env: RUSTFLAGS: -Cinstrument-coverage LLVM_PROFILE_FILE: name-%p-%m.profraw - run: cargo test --verbose + run: cargo test -p afrim-memory -p afrim-preprocessor -p afrim-translator -p afrim-config -p afrim --verbose - name: Run grcov run: | diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c591141..2f17fb3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,20 +43,20 @@ jobs: - name: Rustfmt run: | - cargo fmt -- --check + cargo fmt --all-features -- --check - name: Clippy - run: cargo clippy --all-targets -- -D warnings + run: cargo clippy --all-targets --all-features -- -D warnings - name: Build - run: cargo build --verbose + run: cargo build --all-features --verbose - - name: Run tests - run: | - cargo test --lib --bins --tests --verbose ${{matrix.extra}} - cargo test --benches ${{matrix.extra}} + - name: Run tests (minimal) + run: cargo test --no-default-features --lib --bins --tests --verbose ${{matrix.extra}} + + - name: Run tests (normal) + run: cargo test --lib --bins --tests --verbose ${{matrix.extra}} + + - name: Run tests (full) + run: cargo test --all-features --lib --bins --tests --verbose ${{matrix.extra}} - - name: Check compatibility with Wasm - run: | - rustup target add wasm32-unknown-unknown - cargo build -p afrim-translator -p afrim-preprocessor --target wasm32-unknown-unknown --all-features diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml new file mode 100644 index 0000000..80b862b --- /dev/null +++ b/.github/workflows/web.yml @@ -0,0 +1,35 @@ +name: Web + +on: + workflow_dispatch: + push: + branches: [main, release-*] + pull_request: + branches: [main, release-*] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: libxtst-dev libevdev-dev libxdo-dev + version: 1.0 + + - name: Add components + run: rustup component add clippy rustfmt + + - name: Add wasm target + run: rustup target add wasm32-unknown-unknown + + - name: Clippy + run: cargo clippy -p afrim-translator -p afrim-memory -p afrim-preprocessor --target wasm32-unknown-unknown --all-features + + - name: Build + run: cargo build -p afrim-translator -p afrim-memory -p afrim-preprocessor --target wasm32-unknown-unknown --all-features diff --git a/Cargo.toml b/Cargo.toml index d15f054..0c3fd02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,5 +6,6 @@ members = [ "engine/preprocessor", "engine/translator", ] +default-members = ["service"] resolver = "2"