diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 6a451ccb8..84ba26a88 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,8 +1,9 @@ -# Derived from https://github.com/NixOS/nixpkgs/blob/2ab6f6d61630889491f86396b27a76ffb6fbc7bb/.github/workflows/backport.yml - +--- +# Derived from +# https://github.com/NixOS/nixpkgs/blob/2ab6f6d61630889491f86396b27a76ffb6fbc7bb/.github/workflows/backport.yml name: Backport -on: +on: # yamllint disable-line rule:truthy pull_request_target: types: [closed, labeled] @@ -16,7 +17,10 @@ jobs: ( github.repository_owner == 'danth' && github.event.pull_request.merged == true && - (github.event_name != 'labeled' || startsWith('backport', github.event.label.name)) + ( + github.event_name != 'labeled' || + startsWith('backport', github.event.label.name) + ) ) steps: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5ff87ea41..a36d83812 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,6 +1,7 @@ +--- name: Check -on: +on: # yamllint disable-line rule:truthy push: permissions: @@ -16,7 +17,46 @@ jobs: - id: get-derivations run: | - nix flake show github:${{ github.repository }}/${{ github.event.pull_request.head.sha || github.sha }} --json | jq -rc 'to_entries | map(.key as $type | select($type == "checks" or $type == "packages") | .value | to_entries | map(.key as $arch | select($arch == "x86_64-linux" or $arch == "x86_64-darwin") | .value | to_entries | map({type: $type, arch: $arch, os: (if $arch == "x86_64-linux" then "ubuntu-24.04" else "macos-14" end), key: .key})) | flatten) | flatten | "derivations=\(.)"' >> $GITHUB_OUTPUT + nix flake show --json \ + github:${{ + github.repository + }}/${{ + github.event.pull_request.head.sha || github.sha + }} | + jq --compact-output --raw-output ' + to_entries | + map( + .key as $type | + select($type == "checks" or $type == "packages") | + .value | + to_entries | + map( + .key as $arch | + select($arch == "x86_64-linux" or $arch == "x86_64-darwin") | + .value | + to_entries | + map( + { + arch: $arch, + key: .key, + + os: ( + if $arch == "x86_64-linux" then + "ubuntu-24.04" + else + "macos-14" + end + ), + + type: $type, + } + ) + ) | + flatten + ) | + flatten | + "derivations=\(.)" + ' >> $GITHUB_OUTPUT outputs: derivations: ${{ steps.get-derivations.outputs.derivations }} @@ -35,4 +75,17 @@ jobs: steps: - uses: DeterminateSystems/nix-installer-action@v16 - uses: DeterminateSystems/magic-nix-cache-action@v8 - - run: nix -L check github:${{ github.repository }}/${{ github.event.pull_request.head.sha || github.sha }}#${{ matrix.check.type }}.${{ matrix.check.arch }}.${{ matrix.check.key }} --no-update-lock-file + + - run: | + nix build --no-update-lock-file --print-build-logs \ + github:${{ + github.repository + }}/${{ + github.event.pull_request.head.sha || github.sha + }}#${{ + matrix.check.type + }}.${{ + matrix.check.arch + }}.${{ + matrix.check.key + }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ea2576824..84343e7e7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,7 +1,7 @@ --- name: Docs -on: +on: # yamllint disable-line rule:truthy push: branches: - master diff --git a/flake.nix b/flake.nix index 77ef9f8e6..e62f80403 100644 --- a/flake.nix +++ b/flake.nix @@ -102,6 +102,7 @@ deadnix.enable = true; statix.enable = true; typos.enable = true; + yamllint.enable = true; }; src = ./.;