aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/nix.yml
blob: 0ea5aeeeae93e533938723b9d26e2dcb54ebe1e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Cachix
on:
  push:
jobs:
  cachix:
    name: Cachix branch
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        coq: [ "8.11", "8.10", "8.9" ]
    steps:
      - name: Get branch shortname
        run: echo "##[set-output name=name;]$(echo ${GITHUB_REF#refs/heads/})"
        id: branch-short
      - name: Get owner name
        run: echo "##[set-output name=name;]$(echo $GITHUB_REPOSITORY | cut -d/ -f1)"
        id: owner
      - name: Get owner lowercase name
        run: echo "##[set-output name=name;]$(echo $GITHUB_REPOSITORY | cut -d/ -f1 | tr '[:upper:]' '[:lower:]')"
        id: owner-lowercase
      - uses: cachix/install-nix-action@v8
      - uses: cachix/cachix-action@v6
        if: steps.owner.outputs.name == 'math-comp' || steps.owner.outputs.name == 'CohenCyril'
        with:
          # Name of a cachix cache to push and pull/substitute
          name: ${{ steps.owner-lowercase.outputs.name }}
          # Authentication token for Cachix, needed only for private cache access
          signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
      # building fake mathcomp-fast target
      - run: nix-build https://github.com/math-comp/math-comp-nix/archive/master.tar.gz --arg config '{coq = "${{ matrix.coq }}"; mathcomp = "${{ steps.owner.outputs.name }}/${{ steps.branch-short.outputs.name }}";}' --argstr package mathcomp