diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8e843b39..124227f8 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -14,36 +14,16 @@ jobs: uses: seL4/ci-actions/.github/workflows/pr.yml@master clippy_check: - runs-on: ubuntu-latest - # Make sure CI fails on all warnings, including Clippy lints - env: - RUSTFLAGS: "-Dwarnings" + runs-on: [self-hosted, macos, ARM64] steps: - uses: actions/checkout@v4 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run Clippy - run: cd tool/microkit && cargo clippy --all-targets --all-features + # Make sure CI fails on all warnings, including Clippy lints + run: nix develop --ignore-environment -c bash -c "cd tool/microkit && cargo-clippy --all-targets --all-features -- -D warnings" rustfmt_check: - runs-on: ubuntu-latest + runs-on: [self-hosted, macos, ARM64] steps: - uses: actions/checkout@v4 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run rustfmt - run: cd tool/microkit && cargo fmt --check + run: nix develop --ignore-environment -c bash -c "cd tool/microkit && cargo-fmt --check" diff --git a/tool/microkit/src/elf.rs b/tool/microkit/src/elf.rs index 5f342f86..d6f551c9 100644 --- a/tool/microkit/src/elf.rs +++ b/tool/microkit/src/elf.rs @@ -220,7 +220,7 @@ impl ElfFile { pub fn from_path(path: &Path) -> Result { let bytes = match fs::read(path) { Ok(bytes) => bytes, - Err(err) => return Err(format!("failed to read ELF: {}", err)), + Err(err) => return Err(format!("failed to read ELF: {err}")), }; let magic = &bytes[0..4]; @@ -241,7 +241,7 @@ impl ElfFile { hdr_size = std::mem::size_of::(); word_size = 64; } - _ => return Err(format!("invalid class '{}'", class)), + _ => return Err(format!("invalid class '{class}'")), }; // Now need to read the header into a struct