-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Nix Flake support and CI workflow
- Loading branch information
1 parent
9a19766
commit 4c4c04c
Showing
4 changed files
with
130 additions
and
0 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,32 @@ | ||
name: Nix Flake CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
check-and-build: | ||
name: Check and Build Nix Flake | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
system: [x86_64-linux, aarch64-linux] # Check for multiple systems | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: cachix/install-nix-action@v30 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
|
||
- name: Check Flake | ||
run: nix flake check --all-systems --system ${{ matrix.system }} | ||
|
||
- name: Build Flake | ||
run: nix build .# --system ${{ matrix.system }} | ||
|
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 |
---|---|---|
|
@@ -56,3 +56,6 @@ install_manifest.txt | |
*.dylib | ||
*.so | ||
*.dll | ||
|
||
# Nix build results | ||
result* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
description = "A Package for Automatic Differentiation of Algorithms Written in C/C++ "; | ||
|
||
inputs = { | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; | ||
}; | ||
|
||
outputs = | ||
{ flake-utils, nixpkgs, ... }: | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: | ||
let | ||
pkgs = import nixpkgs { inherit system; }; | ||
in | ||
{ | ||
packages = rec { | ||
adolc-cmake = pkgs.stdenv.mkDerivation { | ||
name = "adolc"; | ||
src = ./.; | ||
nativeBuildInputs = [ pkgs.cmake ]; | ||
}; | ||
|
||
adolc-autotools = adolc-cmake.overrideAttrs ( | ||
_: _: { | ||
nativeBuildInputs = [ pkgs.autoreconfHook ]; | ||
} | ||
); | ||
|
||
default = adolc-cmake; | ||
}; | ||
} | ||
); | ||
} |