Skip to content

Commit

Permalink
Use the toolchain file in GitHub CI (stellar#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Jul 12, 2022
1 parent fc15fc4 commit e9cfe2b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update stable && rustup default stable
- run: find . -type f -name '*.rs' -print0 | xargs -I {} -0 rustfmt --check "{}"
- run: rustup update
- run: cargo fmt --all --check

build-and-test:
strategy:
Expand All @@ -48,12 +48,8 @@ jobs:
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
default: true
components: rustfmt, clippy
target: ${{ matrix.sys.target }}
- run: rustup update
- run: rustup target add ${{ matrix.sys.target }}
- run: cargo install --locked --version 0.5.14 cargo-hack
- run: cargo hack --feature-powerset check --profile ${{ matrix.profile }} --target ${{ matrix.sys.target }}
- if: matrix.sys.test
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
all: build test

export RUSTFLAGS=-Dwarnings

test:
cargo hack --feature-powerset test

Expand All @@ -8,3 +10,9 @@ build:

watch:
cargo watch --clear --watch-when-idle --shell '$(MAKE)'

fmt:
cargo fmt --all

clean:
cargo clean
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "stable"
targets = ["wasm32-unknown-unknown"]
components = ["rustc", "cargo", "rustfmt", "clippy", "rust-src"]

0 comments on commit e9cfe2b

Please sign in to comment.