mirror of
https://github.com/fluencelabs/marine-rs-sdk-test
synced 2024-12-04 15:20:18 +00:00
Add rust-toolchain file and use new setup rust action (#20)
This commit is contained in:
parent
a406e626d6
commit
b44a48b877
37
.github/workflows/marine-rs-sdk-test.yml
vendored
37
.github/workflows/marine-rs-sdk-test.yml
vendored
@ -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
|
||||
|
29
.github/workflows/publish_release.yml
vendored
29
.github/workflows/publish_release.yml
vendored
@ -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
|
||||
|
3
rust-toolchain.toml
Normal file
3
rust-toolchain.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2022-08-30"
|
||||
targets = [ "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "wasm32-wasi" ]
|
Loading…
Reference in New Issue
Block a user