-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves Rust & CI setup to an action so it can be reused. Splits previously sequential build -> clippy -> test steps to individual jobs so they can be executed in parallel. The changes improve organization of the CI pipeline and reduce execution time. Relates to #48.
- Loading branch information
Showing
2 changed files
with
82 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Rust Setup | ||
|
||
inputs: | ||
name: | ||
required: true | ||
type: string | ||
components: | ||
required: false | ||
type: string | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev | ||
- shell: bash | ||
run: "git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id" | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: .git/lfs | ||
key: rust-lfs-${{ inputs.name }}-${{ hashFiles('.lfs-assets-id') }}-v1 | ||
|
||
- shell: bash | ||
run: git lfs pull | ||
|
||
- uses: dtolnay/rust-toolchain@stable | ||
id: rust-toolchain | ||
with: | ||
components: ${{ inputs.components }} | ||
|
||
- shell: bash | ||
run: rustc --version && cargo --version | ||
|
||
- uses: actions/cache@v3 | ||
id: rust-cache | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: rust-cargo-${{ inputs.name }}-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }}-v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters