-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add github workflows and nix checks
- Loading branch information
1 parent
8dc385a
commit f4c5d11
Showing
7 changed files
with
120 additions
and
17 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,13 @@ | ||
name: Build with Nix | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- run: nix build '.?submodules=1#squirrel' |
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,13 @@ | ||
name: Test with Nix | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- run: nix flake check -v |
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,3 +1,6 @@ | ||
# Nix ignores | ||
result | ||
|
||
# CMake ignores | ||
CMakeLists.txt.user | ||
CMakeCache.txt | ||
|
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,34 @@ | ||
{ lib | ||
, gcc | ||
, gnumake | ||
, cmake | ||
, stdenv | ||
}: | ||
|
||
stdenv.mkDerivation { | ||
pname = "squirrel"; | ||
version = "0.0.0"; | ||
|
||
src = ./.; | ||
|
||
nativeBuildInputs = [ cmake gnumake ]; | ||
buildInputs = [ ]; | ||
|
||
cmakeFlags = [ | ||
"-DCMAKE_BUILD_TYPE=Release" | ||
"-DCMAKE_C_COMPILER=${gcc}/bin/gcc" | ||
"-DCMAKE_CXX_COMPILER=${gcc}/bin/g++" | ||
]; | ||
|
||
installPhase = ''cp -r . $out''; | ||
|
||
checkPhase = ''make -C ./build test''; | ||
|
||
meta = with lib; { | ||
homepage = "https://github.com/headblockhead/squirrel"; | ||
description = "Keyboard firmware library inspired by QMK."; | ||
licencse = licenses.mit; | ||
platforms = with platforms; linux; | ||
}; | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,35 @@ | ||
{ lib | ||
, gcc | ||
, gnumake | ||
, cmake | ||
, stdenv | ||
}: | ||
|
||
stdenv.mkDerivation { | ||
pname = "squirrel-tests"; | ||
version = "0.0.0"; | ||
|
||
src = ./.; | ||
|
||
nativeBuildInputs = [ cmake gnumake ]; | ||
buildInputs = [ ]; | ||
|
||
cmakeFlags = [ | ||
"-DCMAKE_BUILD_TYPE=Testing" | ||
"-DCMAKE_C_COMPILER=${gcc}/bin/gcc" | ||
"-DCMAKE_CXX_COMPILER=${gcc}/bin/g++" | ||
]; | ||
|
||
installPhase = '' | ||
cd tests | ||
ctest --timeout 60 # tests should never take longer than 60 seconds each to complete. | ||
cp -r . $out''; | ||
|
||
meta = with lib; { | ||
homepage = "https://github.com/headblockhead/squirrel"; | ||
description = "Keyboard firmware library inspired by QMK."; | ||
licencse = licenses.mit; | ||
platforms = with platforms; linux; | ||
}; | ||
} | ||
|