diff options
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 + |
