Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: improve speeds #39

Merged
merged 4 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# https://github.com/bevyengine/bevy/blob/main/.cargo/config_fast_builds.toml
# https://nnethercote.github.io/perf-book/build-configuration.html

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = [
"-Ctarget-cpu=native",
"-Clink-arg=-fuse-ld=lld",
"-Zshare-generics=y",
"-Zthreads=0",
]
# this is not ideal but we have to comment out to make GitHub Actions runners work on stable
#[target.x86_64-unknown-linux-gnu]
#linker = "clang"
#rustflags = [
# "-Ctarget-cpu=native",
# "-Clink-arg=-fuse-ld=lld",
# "-Zshare-generics=y",
# "-Zthreads=0",
#]

[target.x86_64-unknown-linux-musl]
linker = "clang"
Expand Down
42 changes: 17 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@nightly

- uses: Swatinem/rust-cache@v2

- name: Install cargo-machete
run: cargo install cargo-machete
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-machete

- name: Run cargo machete
run: |
cargo machete

test:
runs-on: ubuntu-latest

Expand All @@ -40,12 +38,11 @@ jobs:
with:
lfs: true

- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Run cargo nextest
run: cargo nextest run
- name: Run cargo test
run: cargo test --workspace --all-features

deny:
runs-on: ubuntu-latest
Expand All @@ -54,12 +51,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly

- uses: Swatinem/rust-cache@v2

- name: Install cargo-deny
run: cargo install cargo-deny
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-deny

- name: Run cargo deny
run: |
Expand All @@ -71,16 +66,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true


- uses: dtolnay/rust-toolchain@nightly
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt

- uses: Swatinem/rust-cache@v2

- name: Run rustfmt
run: |
cargo +nightly fmt --all -- --check
Expand All @@ -93,12 +85,12 @@ jobs:
with:
lfs: true

- uses: dtolnay/rust-toolchain@nightly
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: clippy

- uses: Swatinem/rust-cache@v2

- name: Clippy check
run: cargo clippy --workspace --tests --examples --all-features

Expand Down