Skip to content

Commit

Permalink
Take advantage of Rust reimplementation of Git in Cargo (gitoxide) an…
Browse files Browse the repository at this point in the history
…d shallow clones
  • Loading branch information
nazar-pc committed Jan 19, 2024
1 parent adbf8fc commit d783d7f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ jobs:
${{ runner.os }}-cargo-
- name: cargo fmt
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # @v1.0.1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

cargo-clippy:
strategy:
Expand Down Expand Up @@ -114,10 +111,8 @@ jobs:
${{ runner.os }}-cargo-
- name: cargo clippy
uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # @v1.0.7
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --locked --all-targets --features "runtime-benchmarks" -- -D warnings
run: |
cargo -Zgitoxide -Zgit clippy --locked --all-targets --features "runtime-benchmarks" -- -D warnings
cargo-docs:
runs-on: ${{ fromJson(github.repository_owner == 'subspace' && '["self-hosted", "ubuntu-20.04-x86-64"]' || '"ubuntu-22.04"') }}
Expand All @@ -141,7 +136,7 @@ jobs:
${{ runner.os }}-cargo-
- name: Check Documentation
run: cargo doc --locked --all --no-deps --lib
run: cargo -Zgitoxide -Zgit doc --locked --all --no-deps --lib
env:
RUSTDOCFLAGS: "-D rustdoc::broken-intra-doc-links -D rustdoc::private_intra_doc_links"

Expand Down Expand Up @@ -207,7 +202,5 @@ jobs:
tool: cargo-nextest

- name: cargo nextest run --locked
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # @v1.0.1
with:
command: nextest
args: run --locked
run: |
cargo -Zgitoxide -Zgit nextest run --locked
2 changes: 1 addition & 1 deletion .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
# Build the rust crate docs
- name: Build Documentation
run: cargo doc --all --no-deps --lib
run: cargo -Zgitoxide -Zgit doc --all --no-deps --lib
env:
RUSTDOCFLAGS: "-Z unstable-options --enable-index-page"

Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/snapshot-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,25 +201,19 @@ jobs:
${{ runner.os }}-cargo-
- name: Build farmer (Linux and Windows)
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # @v1.0.1
with:
command: build
args: --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-farmer
run: |
cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-farmer
if: runner.os != 'macOS'

# We build macOS without `numa` feature, primarily because of https://github.com/HadrienG2/hwlocality/issues/31
- name: Build farmer (macOS)
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # @v1.0.1
with:
command: build
args: --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-farmer --no-default-features
run: |
cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-farmer --no-default-features
if: runner.os == 'macOS'

- name: Build node
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # @v1.0.1
with:
command: build
args: --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-node
run: |
cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-node
- name: Sign Application (macOS)
run: |
Expand Down

0 comments on commit d783d7f

Please sign in to comment.