Skip to content

Commit

Permalink
Fix rust-cache in CI (#159)
Browse files Browse the repository at this point in the history
* fix rust-cache

* only workspace path

* allow multithread for cargo test
  • Loading branch information
rnbguy authored Dec 17, 2021
1 parent 9e16eb8 commit 7536350
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:

- name: Install Rust-Cache for Github actions
uses: Swatinem/rust-cache@v1
with:
working-directory: ${{ env.RUST_DIR }}

- name: Install `quickinstall`
uses: actions-rs/cargo@v1
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:

- name: Install Rust-Cache for Github actions
uses: Swatinem/rust-cache@v1
with:
working-directory: ${{ env.RUST_DIR }}

- name: Install `quickinstall`
uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -67,7 +69,7 @@ jobs:
override: true

- name: Rust publish
working-directory: ${{ env.RUST_DIR }}/modelator
working-directory: ${{ env.RUST_DIR }}
run: |
cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ jobs:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
with:
working-directory: rs
- uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path rs/Cargo.toml --no-run
- uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path rs/Cargo.toml -- --test-threads=1
args: --manifest-path rs/Cargo.toml
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
Expand All @@ -64,6 +66,8 @@ jobs:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
with:
working-directory: rs
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
Expand All @@ -81,6 +85,8 @@ jobs:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
with:
working-directory: rs
- uses: actions-rs/cargo@v1
with:
command: doc
Expand All @@ -97,6 +103,8 @@ jobs:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
with:
working-directory: rs
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
Expand Down

0 comments on commit 7536350

Please sign in to comment.