From c3d310c46ffcd6506298cb879d52a865f0613dc0 Mon Sep 17 00:00:00 2001 From: Zykino <5694-Zykino@users.noreply.framagit.org> Date: Mon, 14 Oct 2024 00:21:06 +0200 Subject: [PATCH] CI only on wasm (our target) This is a bit brute force. I suspect test will not work --- .cargo/config.toml | 2 +- .github/workflows/check.yml | 8 ++++++++ .github/workflows/nostd.yml | 30 ------------------------------ .github/workflows/safety.yml | 5 +++++ .github/workflows/scheduled.yml | 4 ++++ .github/workflows/test.yml | 8 ++++++++ 6 files changed, 26 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/nostd.yml diff --git a/.cargo/config.toml b/.cargo/config.toml index 6b77899..6b509f5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [build] -target = "wasm32-wasi" +target = "wasm32-wasip1" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5251954..cba67cf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -31,6 +31,7 @@ jobs: - name: Install stable uses: dtolnay/rust-toolchain@stable with: + target: wasm32-wasip1 components: rustfmt - name: cargo fmt --check run: cargo fmt --check @@ -52,6 +53,7 @@ jobs: - name: Install ${{ matrix.toolchain }} uses: dtolnay/rust-toolchain@master with: + target: wasm32-wasip1 toolchain: ${{ matrix.toolchain }} components: clippy - name: cargo clippy @@ -69,6 +71,7 @@ jobs: - name: Install stable uses: dtolnay/rust-toolchain@stable with: + target: wasm32-wasip1 components: rustfmt - name: cargo-semver-checks uses: obi1kenobi/cargo-semver-checks-action@v2 @@ -84,6 +87,8 @@ jobs: submodules: true - name: Install nightly uses: dtolnay/rust-toolchain@nightly + with: + target: wasm32-wasip1 - name: Install cargo-docs-rs uses: dtolnay/install@cargo-docs-rs - name: cargo docs-rs @@ -99,6 +104,8 @@ jobs: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-wasip1 - name: cargo install cargo-hack uses: taiki-e/install-action@cargo-hack # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 @@ -121,6 +128,7 @@ jobs: - name: Install ${{ matrix.msrv }} uses: dtolnay/rust-toolchain@master with: + target: wasm32-wasip1 toolchain: ${{ matrix.msrv }} - name: cargo +${{ matrix.msrv }} check run: cargo check diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml deleted file mode 100644 index c12227a..0000000 --- a/.github/workflows/nostd.yml +++ /dev/null @@ -1,30 +0,0 @@ -# This workflow checks whether the library is able to run without the std library (e.g., embedded). -# This entire file should be removed if this crate does not support no-std. See check.yml for -# information about how the concurrency cancellation and workflow triggering works -permissions: - contents: read -on: - push: - branches: [main] - pull_request: -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true -name: no-std -jobs: - nostd: - runs-on: ubuntu-latest - name: ${{ matrix.target }} - strategy: - matrix: - target: [thumbv7m-none-eabi, aarch64-unknown-none] - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - name: rustup target add ${{ matrix.target }} - run: rustup target add ${{ matrix.target }} - - name: cargo check - run: cargo check --target ${{ matrix.target }} --no-default-features diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 83da574..33c7a6a 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -24,6 +24,8 @@ jobs: submodules: true - name: Install nightly uses: dtolnay/rust-toolchain@nightly + with: + target: wasm32-wasip1 - run: | # to get the symbolizer for debug symbol resolution sudo apt install llvm @@ -63,6 +65,7 @@ jobs: - name: Install ${{ env.NIGHTLY }} uses: dtolnay/rust-toolchain@master with: + target: wasm32-wasip1 toolchain: ${{ env.NIGHTLY }} components: miri - name: cargo miri test @@ -77,6 +80,8 @@ jobs: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-wasip1 - name: cargo test --test loom run: cargo test --release --test loom env: diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 02aa275..104ba4d 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -24,6 +24,8 @@ jobs: submodules: true - name: Install nightly uses: dtolnay/rust-toolchain@nightly + with: + target: wasm32-wasip1 - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile @@ -48,6 +50,8 @@ jobs: - name: Install beta if: hashFiles('Cargo.lock') != '' uses: dtolnay/rust-toolchain@beta + with: + target: wasm32-wasip1 - name: cargo update if: hashFiles('Cargo.lock') != '' run: cargo update diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7540ae..cdd483e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,7 @@ jobs: - name: Install ${{ matrix.toolchain }} uses: dtolnay/rust-toolchain@master with: + target: wasm32-wasip1 toolchain: ${{ matrix.toolchain }} - name: cargo generate-lockfile # enable this ci template to run regardless of whether the lockfile is checked in or not @@ -74,8 +75,12 @@ jobs: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-wasip1 - name: Install nightly for -Zminimal-versions uses: dtolnay/rust-toolchain@nightly + with: + target: wasm32-wasip1 - name: rustup default stable run: rustup default stable - name: cargo update -Zminimal-versions @@ -102,6 +107,8 @@ jobs: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-wasip1 - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile @@ -138,6 +145,7 @@ jobs: - name: Install stable uses: dtolnay/rust-toolchain@stable with: + target: wasm32-wasip1 components: llvm-tools-preview - name: cargo install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov