From fc84c9d9a3c3d06a41525e3523ffd6d4ae5965ac Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Sat, 9 Jul 2022 12:23:37 +0200 Subject: [PATCH] move selftests to subdirectory and run more selftests --- .github/workflows/selftest.yml | 69 +++++++++++++++---- Cargo.lock => tests/Cargo.lock | 0 Cargo.toml => tests/Cargo.toml | 0 {src => tests/src}/main.rs | 0 .../wasm-workspace}/.cargo/config.toml | 0 .../wasm-workspace}/.gitignore | 0 .../wasm-workspace}/Cargo.toml | 0 .../wasm-workspace}/crates/one/Cargo.toml | 0 .../wasm-workspace}/crates/one/src/main.rs | 0 .../wasm-workspace}/crates/two/Cargo.toml | 0 .../wasm-workspace}/crates/two/src/main.rs | 0 11 files changed, 55 insertions(+), 14 deletions(-) rename Cargo.lock => tests/Cargo.lock (100%) rename Cargo.toml => tests/Cargo.toml (100%) rename {src => tests/src}/main.rs (100%) rename {wasm-workspace => tests/wasm-workspace}/.cargo/config.toml (100%) rename {wasm-workspace => tests/wasm-workspace}/.gitignore (100%) rename {wasm-workspace => tests/wasm-workspace}/Cargo.toml (100%) rename {wasm-workspace => tests/wasm-workspace}/crates/one/Cargo.toml (100%) rename {wasm-workspace => tests/wasm-workspace}/crates/one/src/main.rs (100%) rename {wasm-workspace => tests/wasm-workspace}/crates/two/Cargo.toml (100%) rename {wasm-workspace => tests/wasm-workspace}/crates/two/src/main.rs (100%) diff --git a/.github/workflows/selftest.yml b/.github/workflows/selftest.yml index 3682d0d..1b84c22 100644 --- a/.github/workflows/selftest.yml +++ b/.github/workflows/selftest.yml @@ -3,34 +3,75 @@ name: CI on: [push, pull_request] jobs: - selftest: + simple: strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - name: Test Action on ${{ matrix.os }} + name: Test root check/test on ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true + - run: | + rustup toolchain install --profile minimal stable + rustup default stable - uses: ./ with: - cache-on-failure: true - workspace-paths: | - ./ - wasm-workspace/ + workspace-paths: tests - run: | - cargo install cargo-deny --locked + cd tests cargo check cargo test - rustup target install wasm32-unknown-unknown - cd wasm-workspace && cargo check \ No newline at end of file + + install: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + name: Test `cargo install` on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - run: | + rustup toolchain install --profile minimal stable + rustup default stable + + - uses: ./ + + - run: cargo install cargo-deny --locked + + workspaces: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + name: Test multiple workspaces on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - run: | + rustup toolchain install --profile minimal --target wasm32-unknown-unknown stable + rustup default stable + + - uses: ./ + with: + workspace-paths: | + tests + tests/wasm-workspace + + - run: | + cd tests + cargo check + cd wasm-workspace + cargo check diff --git a/Cargo.lock b/tests/Cargo.lock similarity index 100% rename from Cargo.lock rename to tests/Cargo.lock diff --git a/Cargo.toml b/tests/Cargo.toml similarity index 100% rename from Cargo.toml rename to tests/Cargo.toml diff --git a/src/main.rs b/tests/src/main.rs similarity index 100% rename from src/main.rs rename to tests/src/main.rs diff --git a/wasm-workspace/.cargo/config.toml b/tests/wasm-workspace/.cargo/config.toml similarity index 100% rename from wasm-workspace/.cargo/config.toml rename to tests/wasm-workspace/.cargo/config.toml diff --git a/wasm-workspace/.gitignore b/tests/wasm-workspace/.gitignore similarity index 100% rename from wasm-workspace/.gitignore rename to tests/wasm-workspace/.gitignore diff --git a/wasm-workspace/Cargo.toml b/tests/wasm-workspace/Cargo.toml similarity index 100% rename from wasm-workspace/Cargo.toml rename to tests/wasm-workspace/Cargo.toml diff --git a/wasm-workspace/crates/one/Cargo.toml b/tests/wasm-workspace/crates/one/Cargo.toml similarity index 100% rename from wasm-workspace/crates/one/Cargo.toml rename to tests/wasm-workspace/crates/one/Cargo.toml diff --git a/wasm-workspace/crates/one/src/main.rs b/tests/wasm-workspace/crates/one/src/main.rs similarity index 100% rename from wasm-workspace/crates/one/src/main.rs rename to tests/wasm-workspace/crates/one/src/main.rs diff --git a/wasm-workspace/crates/two/Cargo.toml b/tests/wasm-workspace/crates/two/Cargo.toml similarity index 100% rename from wasm-workspace/crates/two/Cargo.toml rename to tests/wasm-workspace/crates/two/Cargo.toml diff --git a/wasm-workspace/crates/two/src/main.rs b/tests/wasm-workspace/crates/two/src/main.rs similarity index 100% rename from wasm-workspace/crates/two/src/main.rs rename to tests/wasm-workspace/crates/two/src/main.rs