forked from blockworks-foundation/mango-simulation
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request blockworks-foundation#24 from blockworks-foundatio…
…n/ci ci and clippy fixes
- Loading branch information
Showing
13 changed files
with
152 additions
and
116 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,59 @@ | ||
name: Rust Build and Clippy Check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
SCCACHE_GHA_ENABLED: true | ||
RUSTC_WRAPPER: sccache | ||
SCCACHE_CACHE_SIZE: "1G" | ||
|
||
jobs: | ||
build_all: | ||
name: Rust project | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Install Linux Packages | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install libssl-dev openssl -y | ||
- uses: actions/checkout@v4 | ||
|
||
# The toolchain action should definitely be run before the cache action | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
# use toolchain version from rust-toolchain.toml | ||
components: rustfmt, clippy | ||
cache: true | ||
# avoid the default "-D warnings" which thrashes cache | ||
rustflags: "" | ||
|
||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
|
||
# https://github.com/actions/cache/blob/main/examples.md#rust---cargo | ||
# https://blog.arriven.wtf/posts/rust-ci-cache/ | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
# will be covered by sscache | ||
cache-targets: false | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
|
||
- name: Early Build | ||
run: | | ||
cargo build --locked --workspace --tests | ||
- name: Run fmt+clippy | ||
run: | | ||
cargo fmt --all --check | ||
cargo clippy --locked --workspace --all-targets | ||
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
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
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
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
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
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
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
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
Oops, something went wrong.