aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/nix-action.yml
diff options
context:
space:
mode:
authorCyril Cohen2021-03-12 14:17:54 +0100
committerGitHub2021-03-12 14:17:54 +0100
commit0e8ddcaa4f3887b599415870c73a49ceec372016 (patch)
tree8b914fdf342673f42c35f7dece3c58f9dbedb45a /.github/workflows/nix-action.yml
parent476aa248bebcd2eb85b51b0b818dc37eaf94d6f2 (diff)
parent60d56f2bb32201be435b7cd4462dd778ed559aa4 (diff)
Merge pull request #714 from math-comp/nix_v2
Use nix-tool-box
Diffstat (limited to '.github/workflows/nix-action.yml')
-rw-r--r--.github/workflows/nix-action.yml107
1 files changed, 107 insertions, 0 deletions
diff --git a/.github/workflows/nix-action.yml b/.github/workflows/nix-action.yml
new file mode 100644
index 0000000..dc920d9
--- /dev/null
+++ b/.github/workflows/nix-action.yml
@@ -0,0 +1,107 @@
+name: Nix CI
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - '**'
+
+jobs:
+ dependencies:
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
+ steps:
+ - name: Cachix install
+ uses: cachix/install-nix-action@v12
+ with:
+ nix_path: nixpkgs=channel:nixpkgs-unstable
+ - name: Cachix setup coq
+ uses: cachix/cachix-action@v8
+ with:
+ # Name of a cachix cache to pull/substitute
+ name: coq
+ - name: Cachix setup math-comp
+ uses: cachix/cachix-action@v8
+ with:
+ # Name of a cachix cache to pull/substitute
+ name: math-comp
+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+ - name: Git checkout
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Building/fetching dependencies
+ run: nix-build --argstr ci-job dependencies
+ - name: Setup build matrix
+ id: set-matrix
+ run: |
+ matrix=$(nix-shell --arg do-nothing true --run nixTasks)
+ echo ::set-output name=matrix::{\"task\":$(echo $matrix)}\"
+
+ main:
+ runs-on: ubuntu-latest
+ needs:
+ - dependencies
+ strategy:
+ matrix: ${{fromJson(needs.dependencies.outputs.matrix)}}
+ fail-fast: false
+ steps:
+ - name: Cachix install
+ uses: cachix/install-nix-action@v12
+ with:
+ nix_path: nixpkgs=channel:nixpkgs-unstable
+ - name: Cachix setup coq
+ uses: cachix/cachix-action@v8
+ with:
+ # Name of a cachix cache to pull/substitute
+ name: coq
+ - name: Cachix setup math-comp
+ uses: cachix/cachix-action@v8
+ with:
+ # Name of a cachix cache to pull/substitute
+ name: math-comp
+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+ - name: Git checkout
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Building/fetching dependencies
+ run: nix-build --no-out-link --argstr ci "${{ matrix.task }}" --argstr ci-job dependencies
+ - name: Building/fetching current project
+ run: nix-build --no-out-link --argstr ci "${{ matrix.task }}" --argstr ci-job main
+
+ shell:
+ runs-on: ubuntu-latest
+ needs:
+ - dependencies
+ strategy:
+ matrix: ${{fromJson(needs.dependencies.outputs.matrix)}}
+ fail-fast: false
+ steps:
+ - name: Cachix install
+ uses: cachix/install-nix-action@v12
+ with:
+ nix_path: nixpkgs=channel:nixpkgs-unstable
+ - name: Cachix setup coq
+ uses: cachix/cachix-action@v8
+ with:
+ # Name of a cachix cache to pull/substitute
+ name: coq
+ - name: Cachix setup math-comp
+ uses: cachix/cachix-action@v8
+ with:
+ # Name of a cachix cache to pull/substitute
+ name: math-comp
+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+ - name: Git checkout
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Building/fetching dependencies
+ run: nix-build --no-out-link --argstr ci "${{ matrix.task }}" --argstr ci-job dependencies
+ - name: Building/fetching current project
+ run: nix-build --no-out-link --argstr ci "${{ matrix.task }}" --argstr ci-job shell
+