diff --git a/.github/workflows/marine-rs-sdk-test.yml b/.github/workflows/marine-rs-sdk-test.yml index 7158566..f8fd4f4 100644 --- a/.github/workflows/marine-rs-sdk-test.yml +++ b/.github/workflows/marine-rs-sdk-test.yml @@ -10,43 +10,36 @@ concurrency: group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true -jobs: - build: - name: "Build and test" - runs-on: builder +env: + RUST_TEST_THREADS: 1 + CARGO_HOME: "${{ github.workspace }}/cargo" - env: - RUST_BACKTRACE: 1 - RUST_TEST_THREADS: 1 - CARGO_TERM_COLOR: always +jobs: + marine-rs-sdk-test: + name: "Run tests" + runs-on: builder steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - default: true - components: rustfmt, clippy + - name: Setup rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: "Cache rust" - uses: Swatinem/rust-cache@v1 - - - name: "cargo fmt" + - name: Run cargo fmt run: cargo fmt --all -- --check - - name: "cargo build" + - name: Run cargo build run: cargo build - - name: "cargo check" + - name: Run cargo check run: cargo check -v --all-features - - name: "Run marine-test-macro-impl" + - name: Run cargo test in marine-test-macro-impl run: cargo test working-directory: crates/marine-test-macro-impl - - name: "cargo test" + - name: Run cargo test run: cargo test --release --all-features --no-fail-fast - - name: "cargo clippy" + - name: Run cargo clippy run: cargo clippy -Z unstable-options --all diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 0414743..90348c0 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -7,34 +7,15 @@ jobs: npm-publish: name: "Publish release" runs-on: ubuntu-latest - defaults: - run: - shell: bash steps: - name: Checkout repository uses: actions/checkout@v2 - ### Prepare cargo & toolchains - - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ~/.cargo/bin - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - profile: minimal - override: true - - uses: actions-rs/cargo@v1 - with: - toolchain: nightly - command: update - args: --aggressive + - name: Setup rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - run: cargo update --aggressive - name: Install jq run: sudo apt-get update && sudo apt-get --yes --force-yes install jq @@ -42,7 +23,6 @@ jobs: - name: Install cargo-workspaces run: cargo install cargo-workspaces || true - ### === Rust package release === - name: Login to crates.io run: cargo login ${{ secrets.CRATES_IO_TOKEN }} @@ -57,7 +37,6 @@ jobs: - name: Publish to crates.io run: cargo ws publish --no-git-commit --from-git --skip-published --yes - ### Create a release - name: Create Release id: create_release uses: actions/create-release@v1 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..1b3380c --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "nightly-2022-08-30" +targets = [ "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "wasm32-wasi" ]