diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 78eaab8..1303e95 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -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 @@ -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 }} + " diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index ac6c62d..ec052c9 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -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 @@ -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 \ No newline at end of file + run: nix develop --command sh -c " + cd kernel && + cargo doc --target ${{ env.TARGET }} --all-features + " diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index c8d733f..8d5abf2 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -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 + " diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55d48c3..581f20a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 + "