Merge From nixos-unstable #509
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI" | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: write-all | |
jobs: | |
generate-nixconf: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
github-token: ${{ secrets.GH_TOKEN }} | |
extra-conf: | | |
experimental-features = nix-command flakes pipe-operators | |
- run: nix run .#gcn > nix.conf | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: nix-conf | |
path: nix.conf | |
swayfx: | |
runs-on: ubuntu-latest | |
needs: [ generate-nixconf ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: nix-conf | |
- name: Read nix.conf | |
id: nix | |
run: | | |
{ | |
echo 'CONF<<EOF' | |
cat nix.conf | |
echo 'EOF' | |
} >> "$GITHUB_OUTPUT" | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
github-token: ${{ secrets.GH_TOKEN }} | |
extra-conf: | | |
${{ steps.nix.outputs.CONF }} | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
with: | |
use-flakehub: false | |
- uses: cachix/cachix-action@master | |
with: | |
name: fmcachix | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
skipAddingSubstituter: true | |
- name: Build | |
run: nix build .#custom.swayfx --verbose | |
- run: nix-collect-garbage -d | |
gnome-session: | |
runs-on: ubuntu-latest | |
needs: [ generate-nixconf ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: nix-conf | |
- name: Read nix.conf | |
id: nix | |
run: | | |
{ | |
echo 'CONF<<EOF' | |
cat nix.conf | |
echo 'EOF' | |
} >> "$GITHUB_OUTPUT" | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
github-token: ${{ secrets.GH_TOKEN }} | |
extra-conf: | | |
${{ steps.nix.outputs.CONF }} | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
with: | |
use-flakehub: false | |
- uses: cachix/cachix-action@master | |
with: | |
name: fmcachix | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
skipAddingSubstituter: true | |
- name: Build | |
run: nix build .#gnome-session --verbose | |
- run: nix-collect-garbage -d | |
nixos: | |
runs-on: ubuntu-latest | |
needs: | |
- generate-nixconf | |
- swayfx | |
- gnome-session | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: "Check current branch" | |
run: git branch | |
- uses: actions/download-artifact@v4 | |
with: | |
name: nix-conf | |
- name: Read nix.conf | |
id: nix | |
run: | | |
{ | |
echo 'CONF<<EOF' | |
cat nix.conf | |
echo 'EOF' | |
} >> "$GITHUB_OUTPUT" | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
github-token: ${{ secrets.GH_TOKEN }} | |
extra-conf: | | |
${{ steps.nix.outputs.CONF }} | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
with: | |
use-flakehub: false | |
- name: Build | |
run: nix build .#nixosConfigurations.minimal.config.system.build.toplevel --verbose | |
- name: Info | |
run: nix path-info -Sh ./result | |
auto-merge: | |
needs: [ nixos ] | |
runs-on: ubuntu-latest | |
if: ${{ !cancelled() && success() && !contains(needs.*.result, 'skipped') }} | |
steps: | |
- name: Enable auto-merge | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: ${{ github.head_ref }} | |
run: | | |
if [[ "${BRANCH}" != "nixos-unstable" ]]; then | |
gh pr merge --auto --merge "$PR_URL" -d | |
else | |
gh pr merge --auto --merge "$PR_URL" | |
fi |