mirror of
https://github.com/fluencelabs/marine-rs-sdk-test
synced 2025-04-24 23:12:13 +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 }}"
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
env:
|
||||||
build:
|
RUST_TEST_THREADS: 1
|
||||||
name: "Build and test"
|
CARGO_HOME: "${{ github.workspace }}/cargo"
|
||||||
runs-on: builder
|
|
||||||
|
|
||||||
env:
|
jobs:
|
||||||
RUST_BACKTRACE: 1
|
marine-rs-sdk-test:
|
||||||
RUST_TEST_THREADS: 1
|
name: "Run tests"
|
||||||
CARGO_TERM_COLOR: always
|
runs-on: builder
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- name: Setup rust toolchain
|
||||||
with:
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
toolchain: nightly
|
|
||||||
default: true
|
|
||||||
components: rustfmt, clippy
|
|
||||||
|
|
||||||
- name: "Cache rust"
|
- name: Run cargo fmt
|
||||||
uses: Swatinem/rust-cache@v1
|
|
||||||
|
|
||||||
- name: "cargo fmt"
|
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
- name: "cargo build"
|
- name: Run cargo build
|
||||||
run: cargo build
|
run: cargo build
|
||||||
|
|
||||||
- name: "cargo check"
|
- name: Run cargo check
|
||||||
run: cargo check -v --all-features
|
run: cargo check -v --all-features
|
||||||
|
|
||||||
- name: "Run marine-test-macro-impl"
|
- name: Run cargo test in marine-test-macro-impl
|
||||||
run: cargo test
|
run: cargo test
|
||||||
working-directory: crates/marine-test-macro-impl
|
working-directory: crates/marine-test-macro-impl
|
||||||
|
|
||||||
- name: "cargo test"
|
- name: Run cargo test
|
||||||
run: cargo test --release --all-features --no-fail-fast
|
run: cargo test --release --all-features --no-fail-fast
|
||||||
|
|
||||||
- name: "cargo clippy"
|
- name: Run cargo clippy
|
||||||
run: cargo clippy -Z unstable-options --all
|
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:
|
npm-publish:
|
||||||
name: "Publish release"
|
name: "Publish release"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
### Prepare cargo & toolchains
|
- name: Setup rust toolchain
|
||||||
- uses: actions/cache@v2
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
|
||||||
path: |
|
- run: cargo update --aggressive
|
||||||
~/.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: Install jq
|
- name: Install jq
|
||||||
run: sudo apt-get update && sudo apt-get --yes --force-yes install jq
|
run: sudo apt-get update && sudo apt-get --yes --force-yes install jq
|
||||||
@ -42,7 +23,6 @@ jobs:
|
|||||||
- name: Install cargo-workspaces
|
- name: Install cargo-workspaces
|
||||||
run: cargo install cargo-workspaces || true
|
run: cargo install cargo-workspaces || true
|
||||||
|
|
||||||
### === Rust package release ===
|
|
||||||
- name: Login to crates.io
|
- name: Login to crates.io
|
||||||
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
|
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
|
||||||
|
|
||||||
@ -57,7 +37,6 @@ jobs:
|
|||||||
- name: Publish to crates.io
|
- name: Publish to crates.io
|
||||||
run: cargo ws publish --no-git-commit --from-git --skip-published --yes
|
run: cargo ws publish --no-git-commit --from-git --skip-published --yes
|
||||||
|
|
||||||
### Create a release
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
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…
x
Reference in New Issue
Block a user