-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from datsfilipe/add-flake-generation-workflow
add flake generation workflow (test)
- Loading branch information
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
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,41 @@ | ||
name: generate flake | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test-flake-generation: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Up Nix | ||
uses: cachix/install-nix-action@v22 | ||
with: | ||
nix_version: latest | ||
extra_nix_config: | | ||
experimental-features = nix-command flakes | ||
- name: Test Flake Generation | ||
run: | | ||
if [ -f flake.nix ]; then | ||
if ! command -v trash-cli &> /dev/null; then | ||
rm flake.nix | ||
else | ||
trash-put flake.nix | ||
fi | ||
fi | ||
nix eval --raw -f templates/flake.template.nix flake > flake.nix | ||
- name: Verify Flake | ||
run: | | ||
if [ -f flake.nix ]; then | ||
echo "flake.nix successfully generated" | ||
else | ||
echo "flake.nix generation failed" && exit 1 | ||
fi |
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,4 +1,4 @@ | ||
name: Run NixOS Tests | ||
name: run tests | ||
|
||
on: | ||
push: | ||
|
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