diff options
| author | Cyril Cohen | 2021-03-12 10:18:31 +0100 |
|---|---|---|
| committer | Cyril Cohen | 2021-03-12 13:51:10 +0100 |
| commit | 60d56f2bb32201be435b7cd4462dd778ed559aa4 (patch) | |
| tree | 8b914fdf342673f42c35f7dece3c58f9dbedb45a /.github/workflows/nix-action.yml | |
| parent | 476aa248bebcd2eb85b51b0b818dc37eaf94d6f2 (diff) | |
Use nix-tool-box
Diffstat (limited to '.github/workflows/nix-action.yml')
| -rw-r--r-- | .github/workflows/nix-action.yml | 107 |
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 + |
