zellij/.github/workflows/nix-develop.yml
a-kenji bb2b8ddc82 fix(ci): move nix build -> nix-develop
This will trigger the nix build workflow, only on changes in the nix
files.

- This won't generate precompiled artifacts for any person wanting to
  use them from the main branch anymore.

  Also PR's that pass CI won't be able to be run with:
  ```
  nix run github:zellij-org/zellij/pr#
  ```
  without compilation anymore on any linux, or darwin system.
2022-12-12 08:19:46 +01:00

72 lines
2.1 KiB
YAML

# 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"
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@v18
- uses: cachix/cachix-action@v12
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"
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@v18
- uses: cachix/cachix-action@v12
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
build:
runs-on: ubuntu-latest
name: "nix build"
timeout-minutes: 35
steps:
- uses: actions/checkout@v3
with:
# Nix Flakes doesn't work on shallow clones
fetch-depth: 0
- uses: cachix/install-nix-action@v18
- uses: cachix/cachix-action@v12
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 build || nix build --substituters 'https://cache.nixos.org' --extra-substituters ''