Skip to content

Commit

Permalink
ci: use nix flake
Browse files Browse the repository at this point in the history
In order to have a unified environment between the CI and our
development machines we introduced a nix flake. It's now time to use it
in the CI

Signed-off-by: Esteban Blanc <[email protected]>
  • Loading branch information
Skallwar committed Oct 9, 2024
1 parent b29b18f commit 13996f7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 49 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: clippy
targets: ${{ env.TARGET }}
- run: cd riscv64_qemuvirt && cargo clippy --all-features --target ${{ env.TARGET }}
- uses: cachix/install-nix-action@v27

- name: Run clippy
run: nix develop --command sh -c "
cd riscv64_qemuvirt &&
cargo clippy --all-features --target ${{ env.TARGET }}
"
clippy_aarch64:
runs-on: ubuntu-latest
Expand All @@ -28,9 +29,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: clippy
targets: ${{ env.TARGET }}
- run: cd aarch64_qemuvirt && cargo clippy --all-features --target ${{ env.TARGET }}
- uses: cachix/install-nix-action@v27
- name: Run clippy
run: nix develop --command sh -c "
cd aarch64_qemuvirt &&
cargo clippy --all-features --target ${{ env.TARGET }}
"
20 changes: 10 additions & 10 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
targets: ${{ env.TARGET }}
- uses: cachix/install-nix-action@v27

- name: Build doc
run: cd kernel && cargo doc --target ${{ env.TARGET }} --all-features
run: nix develop --command sh -c "
cd kernel &&
cargo doc --target ${{ env.TARGET }} --all-features
"
doc_aarch64:
runs-on: ubuntu-latest
Expand All @@ -29,10 +29,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
targets: ${{ env.TARGET }}
- uses: cachix/install-nix-action@v27
- name: Build doc
run: cd kernel && cargo doc --target ${{ env.TARGET }} --all-features
run: nix develop --command sh -c "
cd kernel &&
cargo doc --target ${{ env.TARGET }} --all-features
"
10 changes: 4 additions & 6 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
override: true
- uses: cachix/install-nix-action@v27

- name: Format
run: cargo fmt -- --check
run: nix develop --command sh -c "
cargo fmt -- --check
"
35 changes: 14 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,29 @@ on:
jobs:
test_riscv64:
runs-on: ubuntu-latest
env:
TARGET: riscv64gc-unknown-none-elf
steps:
- uses: actions/checkout@v2

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: clippy
targets: ${{ env.TARGET }}
- uses: cachix/install-nix-action@v27

- name: Install qemu
run: sudo apt-get update && sudo apt-get install qemu-system-misc opensbi

- run: cd riscv64_qemuvirt && cargo run -F launch_tests
- name: Run tests
run: nix develop --command sh -c "
cd riscv64_qemuvirt &&
cargo run -F launch_tests
"
test_aarch64:
runs-on: ubuntu-latest
env:
TARGET: aarch64-unknown-none
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: clippy
targets: ${{ env.TARGET }}
- uses: cachix/install-nix-action@v27
- name: Install qemu
run: sudo apt-get update && sudo apt-get install qemu-system-arm
- name: Enter nix
run: nix develop
- run: cd aarch64_qemuvirt && cargo run -F launch_tests
- name: Run tests
run: nix develop --command sh -c "
cd aarch64_qemuvirt &&
cargo run -F launch_tests
"

0 comments on commit 13996f7

Please sign in to comment.