summaryrefslogtreecommitdiffstats
path: root/.github/workflows/nix-develop.yml
blob: 18ae69437926d9449f1dcfc489464fcce09efab6 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This is a workflow, consisting of jobs that only need to be run,
# once `*nix`, or `flake.lock` files change
name: nix-develop

on:
  push:
    branches:
      - main
    paths:
      - '**.nix'
      - 'flake.lock'
      - 'rust-toolchain'
  pull_request:
    branches:
      - main
    paths:
      - '**.nix'
      - 'flake.lock'
      - 'rust-toolchain'

jobs:
  check:
    runs-on: ubuntu-latest
    name: "nix check"
    environment: cachix
    timeout-minutes: 5
    steps:
      - uses: actions/checkout@v3
        with:
          # Nix Flakes doesn't work on shallow clones
          fetch-depth: 0
      - uses: cachix/install-nix-action@v16
      - uses: cachix/cachix-action@v10
        with:
          name: zellij
          # If you chose API tokens for write access OR if you have a private cache
          authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
      - run: nix develop .#fmtShell --command treefmt --fail-on-change
      ## nix flake check still fails on IFD
      #- run: nix flake check --print-build-logs --show-trace
  develop:
    runs-on: ubuntu-latest
    name: "nix develop"
    environment: cachix
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v3
        with:
          # Nix Flakes doesn't work on shallow clones
          fetch-depth: 0
      - uses: cachix/install-nix-action@v16
      - uses: cachix/cachix-action@v10
        with:
          name: zellij
          # If you chose API tokens for write access OR if you have a private cache
          authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
      - run: nix develop --profile devShell