Skip to content

Commit

Permalink
Run rust checks/tests outside nix
Browse files Browse the repository at this point in the history
  • Loading branch information
c12i committed Nov 12, 2024
1 parent 3fdec66 commit 9417478
Showing 1 changed file with 21 additions and 42 deletions.
63 changes: 21 additions & 42 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "test"
name: "scaffolding-ci"

on:
# Trigger the workflow on push or pull request,
Expand All @@ -13,46 +13,29 @@ concurrency:
cancel-in-progress: true

jobs:
test_fmt_lint:
cargo_test:
name: cargo_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- run: cargo test --no-fail-fast

- name: Maximize build space
if: runner.os == 'Linux'
uses: AdityaGarg8/remove-unwanted-software@v2
with:
remove-dotnet: "true"
remove-android: "true"
remove-codeql: "true"
remove-docker-images: "true"

- name: Install nix
uses: cachix/install-nix-action@v27
with:
install_url: https://releases.nixos.org/nix/nix-2.24.4/install

- uses: cachix/cachix-action@v15
with:
name: holochain-scaffolding-cli
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- uses: Swatinem/rust-cache@v2

- name: rustfmt check
run: |
cd $GITHUB_WORKSPACE
nix develop .#ci --command cargo fmt --all --check
- name: clippy check
run: |
cd $GITHUB_WORKSPACE
nix develop .#ci --command cargo clippy --all-features --all-targets -- -D warnings
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- run: cargo fmt --all -- --check

- name: unittests
run: |
cd $GITHUB_WORKSPACE
nix develop .#ci --command cargo test --no-fail-fast
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- run: cargo clippy -- -D warnings

testbuild:
runs-on: ubuntu-latest
Expand All @@ -72,7 +55,7 @@ jobs:
remove-docker-images: "true"

- name: Install nix
uses: cachix/install-nix-action@v27
uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-2.24.4/install

Expand All @@ -81,8 +64,6 @@ jobs:
name: holochain-scaffolding-cli
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- uses: Swatinem/rust-cache@v2

- name: Build and test
run: |
cd $GITHUB_WORKSPACE
Expand All @@ -108,7 +89,7 @@ jobs:
remove-docker-images: "true"

- name: Install nix
uses: cachix/install-nix-action@v27
uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-2.24.4/install

Expand All @@ -117,8 +98,6 @@ jobs:
name: holochain-scaffolding-cli
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- uses: Swatinem/rust-cache@v2

- name: Build and test
run: |
cd $GITHUB_WORKSPACE
Expand Down

0 comments on commit 9417478

Please sign in to comment.