diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 7bcdd5248..45fcae6b5 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,3 @@ # If you are a frequent contributor to uefi-rs and would like to be featured in # the sponsors section, please contact the maintainers. - github: phip1611 diff --git a/.github/workflows/developer_productivity.yml b/.github/workflows/developer_productivity.yml index 0f60b8a79..f0a8d1497 100644 --- a/.github/workflows/developer_productivity.yml +++ b/.github/workflows/developer_productivity.yml @@ -34,7 +34,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - - uses: cachix/install-nix-action@v30 + - uses: cachix/install-nix-action@v31 # Dedicated step to separate all the # "copying path '/nix/store/...' from 'https://cache.nixos.org'." # messages from the actual build output. diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 5842e5a9f..dc53347cb 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -8,3 +8,35 @@ jobs: - uses: actions/checkout@v4 # Executes "typos ." - uses: crate-ci/typos@v1.30.2 + lints: + name: Lints + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v31 + - uses: Swatinem/rust-cache@v2 + # Dedicated step to separate all the + # "copying path '/nix/store/...' from 'https://cache.nixos.org'." + # messages from the actual build output. + - name: Prepare Nix Store + run: nix develop --command echo + # A dedicated step removes spam from the actual job. + - name: Build cargo xtask + run: cargo xtask help >/dev/null + # Executing this in a Nix shell ensures that all our checks run as all + # required tooling exists. + - name: Check formatting + run: | + CMD="cargo xtask fmt --check" + nix develop --command bash -c "$CMD" + - name: Run clippy + run: | + rustup component add clippy + cargo xtask clippy --warnings-as-errors + - name: Run cargo doc (without unstable) + run: cargo xtask doc --warnings-as-errors --document-private-items + - name: Verify generated code is up-to-date + run: cargo xtask gen-code --check + - name: Run additional checks on the uefi-raw package + run: cargo xtask check-raw diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 32eea8415..ecd86a8f7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -81,33 +81,6 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Run cargo test (without unstable) run: cargo xtask test - lints: - name: Lints - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - uses: Swatinem/rust-cache@v2 - - name: Install yamlfmt - env: - YFV: "0.13.0" - HASH: "043e96d754a8afa4f4c5c13ffb2f3e50c6be5a70bf53292d3025abc0b42fe4ae" - run: | - curl -L --fail --output /tmp/yamlfmt.tar.xz https://github.com/google/yamlfmt/releases/download/v${YFV}/yamlfmt_${YFV}_Linux_x86_64.tar.gz - echo "${HASH} /tmp/yamlfmt.tar.xz" | sha256sum --check - tar xf /tmp/yamlfmt.tar.xz -C /usr/local/bin yamlfmt - - name: Check formatting - run: cargo xtask fmt --check - - name: Run clippy - run: | - rustup component add clippy - cargo xtask clippy --warnings-as-errors - - name: Run cargo doc (without unstable) - run: cargo xtask doc --warnings-as-errors --document-private-items - - name: Verify generated code is up-to-date - run: cargo xtask gen-code --check - - name: Run additional checks on the uefi-raw package - run: cargo xtask check-raw # Run the build with our current stable MSRV (specified in # ./msrv_toolchain.toml). This serves to check that we don't # accidentally start relying on a new feature without intending diff --git a/flake.lock b/flake.lock index e97a8b0f2..7ef268fd1 100644 --- a/flake.lock +++ b/flake.lock @@ -2,16 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1740743217, - "narHash": "sha256-brsCRzLqimpyhORma84c3W2xPbIidZlIc3JGIuQVSNI=", + "lastModified": 1743814133, + "narHash": "sha256-drDyYyUmjeYGiHmwB9eOPTQRjmrq3Yz26knwmMPLZFk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b27ba4eb322d9d2bf2dc9ada9fd59442f50c8d7c", + "rev": "250b695f41e0e2f5afbf15c6b12480de1fe0001b", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.11", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -43,11 +43,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1740882709, - "narHash": "sha256-VC+8GxWK4p08jjIbmsNfeFQajW2lsiOR/XQiOOvqgvs=", + "lastModified": 1743906877, + "narHash": "sha256-Thah1oU8Vy0gs9bh5QhNcQh1iuQiowMnZPbrkURonZA=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "f4d5a693c18b389f0d58f55b6f7be6ef85af186f", + "rev": "9d00c6b69408dd40d067603012938d9fbe95cfcd", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 69f1a6f80..1a29f2265 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,10 @@ description = "uefi-rs"; inputs = { - # We follow the latest stable release of nixpkgs - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + # Use freshest nixpkgs. We don't use master as packages in nixpkgs-unstable + # have already been build by the nixpkgs CI and are available from the + # nixos.org cache. + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; rust-overlay.url = "github:oxalica/rust-overlay"; }; diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 91e288eb9..c98dec829 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -309,15 +309,23 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> { eprintln!("Formatting: yml - SKIPPED"); } - // fmt nix - if has_cmd("nixfmt") { + // fmt nix (by passing files as arguments) + // `find . -name "*.nix" -type f -exec nix fmt {} \+` + if has_cmd("find") && has_cmd("nixfmt") { eprintln!("Formatting: nix"); - let mut command = Command::new("nixfmt"); + let mut command = Command::new("find"); + command.arg("."); + command.arg("-name"); + command.arg("*.nix"); + command.arg("-type"); + command.arg("f"); + command.arg("-exec"); + command.arg("nixfmt"); if fmt_opt.check { command.arg("--check"); } - command.arg("nix"); - command.arg("shell.nix"); + command.arg("{}"); + command.arg("+"); match run_cmd(command) { Ok(_) => {