-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: clean up nix workflows; build default package
- Loading branch information
Showing
3 changed files
with
88 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This is a re-usable workflow that is used by .github/workflows/check.yml to handle necessary setup | ||
# before running Nix commands. E.g. this will install Nix and set up Magic Nix Cache | ||
name: "Nix Setup" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
command: | ||
required: false | ||
type: string | ||
platform: | ||
default: "ubuntu" | ||
required: false | ||
type: string | ||
secrets: | ||
GH_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
nix: | ||
runs-on: "${{ inputs.platform }}-latest" | ||
steps: | ||
- name: "Set default git branch (to reduce log spam)" | ||
run: git config --global init.defaultBranch main | ||
|
||
- name: "Checkout" | ||
uses: actions/checkout@v4 | ||
with: | ||
token: "${{ secrets.GH_TOKEN }}" | ||
|
||
- name: "Set up QEMU support" | ||
run: | | ||
# This will allow for cross-compilation using Nix | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update -q -y | ||
sudo apt-get install -q -y binfmt-support qemu-efi qemu-system-aarch64 qemu-user-static | ||
- name: "Install nix" | ||
uses: cachix/install-nix-action@master | ||
with: | ||
install_url: https://nixos.org/nix/install | ||
extra_nix_config: | | ||
experimental-features = nix-command flakes fetch-tree | ||
allow-import-from-derivation = false | ||
extra-platforms = aarch64-linux | ||
- name: "Cachix Setup" | ||
uses: cachix/cachix-action@v14 | ||
with: | ||
authToken: ${{ secrets.CACHIX_TOKEN }} | ||
name: hyprland-community | ||
|
||
- name: "Nix Magic Cache" | ||
uses: DeterminateSystems/magic-nix-cache-action@main | ||
|
||
- name: "Run Input: ${{ inputs.command }}" | ||
run: "${{ inputs.command }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,36 @@ | ||
# This is a re-usable workflow that is used by .github/workflows/check.yml to handle necessary setup | ||
# before running Nix commands. E.g. this will install Nix and set up Magic Nix Cache | ||
name: "Nix Setup" | ||
name: Check Flake Validity | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
command: | ||
required: false | ||
type: string | ||
platform: | ||
default: "ubuntu" | ||
required: false | ||
type: string | ||
secrets: | ||
GH_TOKEN: | ||
required: true | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- "pyprland/**" | ||
- "**.nix" | ||
- "**.lock" | ||
- ".github/workflows/check.yml" | ||
push: | ||
paths: | ||
- "pyprland/**" | ||
- "**.nix" | ||
- "**.lock" | ||
- ".github/workflows/check.yml" | ||
|
||
jobs: | ||
nix: | ||
runs-on: "${{ inputs.platform }}-latest" | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v4 | ||
with: | ||
token: "${{ secrets.GH_TOKEN }}" | ||
|
||
- name: "Set up QEMU support" | ||
run: | | ||
# This will allow for cross-compilation using Nix | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update -q -y | ||
sudo apt-get install -q -y binfmt-support qemu-efi qemu-system-aarch64 qemu-user-static | ||
- name: "Install nix" | ||
uses: cachix/install-nix-action@master | ||
with: | ||
install_url: https://nixos.org/nix/install | ||
extra_nix_config: | | ||
experimental-features = nix-command flakes fetch-tree | ||
allow-import-from-derivation = false | ||
extra-platforms = aarch64-linux | ||
# extra substituters | ||
# nix-community | ||
extra-substituters = https://nix-community.cachix.org | ||
extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= | ||
- name: "Nix Magic Cache" | ||
uses: DeterminateSystems/magic-nix-cache-action@main | ||
check: | ||
uses: ./.github/workflows/nix.yml | ||
secrets: | ||
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
with: | ||
command: nix flake check --accept-flake-config --print-build-logs | ||
|
||
- name: "Run Input: ${{ inputs.command }}" | ||
run: "${{ inputs.command }}" | ||
build: | ||
needs: [check] | ||
uses: ./.github/workflows/nix.yml | ||
strategy: | ||
matrix: | ||
package: | ||
- pyprland | ||
secrets: | ||
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
with: | ||
command: nix build .#${{ matrix.package }} --print-build-logs |