forked from lix-project/nix-eval-jobs
commit
36c0308a42
45
.github/workflows/flake-check.yml
vendored
Normal file
45
.github/workflows/flake-check.yml
vendored
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
name: "Flake checks"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
flake-checks:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.4.0
|
||||||
|
with:
|
||||||
|
# Nix Flakes doesn't work on shallow clones
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: cachix/install-nix-action@v16
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
- id: set-matrix
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
matrix="$(nix flake show --json | jq '.checks."x86_64-linux" | keys' | jq -rcM '{attr: ., os: ["ubuntu-latest", "macos-latest"]}')"
|
||||||
|
echo "::set-output name=matrix::$matrix"
|
||||||
|
|
||||||
|
builds:
|
||||||
|
needs: flake-checks
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix: ${{fromJSON(needs.flake-checks.outputs.matrix)}}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.4.0
|
||||||
|
with:
|
||||||
|
# Nix Flakes doesn't work on shallow clones
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: cachix/install-nix-action@v16
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
- run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
system=$(nix-instantiate --eval --expr builtins.currentSystem | jq -r)
|
||||||
|
nix build -L .#checks.$system.${{ matrix.attr }}
|
|
@ -1,11 +1,9 @@
|
||||||
name: "Test"
|
name: "Development workflow - nix-shell"
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
schedule:
|
|
||||||
- cron: '51 2 * * *'
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -15,5 +13,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v16
|
- uses: cachix/install-nix-action@v16
|
||||||
- name: build
|
with:
|
||||||
run: NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz nix-build --expr '(import <nixpkgs> { }).callPackage ./. { }'
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
- name: Build
|
||||||
|
run: nix-shell --run 'meson build && cd build && ninja'
|
||||||
|
- name: Run tests
|
||||||
|
run: nix-shell --run 'pytest ./tests'
|
|
@ -1,11 +1,9 @@
|
||||||
name: "Flake test"
|
name: "Development workflow - flakes"
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
schedule:
|
|
||||||
- cron: '51 2 * * *'
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -18,11 +16,7 @@ jobs:
|
||||||
# Nix Flakes doesn't work on shallow clones
|
# Nix Flakes doesn't work on shallow clones
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: cachix/install-nix-action@v16
|
- uses: cachix/install-nix-action@v16
|
||||||
- name: List flake structure
|
|
||||||
run: nix flake show
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: nix build --out-link result
|
run: nix develop -c bash -c 'meson build && cd build && ninja'
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: nix develop -c pytest ./tests
|
||||||
nix develop -c install -D ./result/bin/nix-eval-jobs ./build/src/nix-eval-jobs
|
|
||||||
nix develop -c pytest ./tests
|
|
2
.github/workflows/update-flake-lock.yml
vendored
2
.github/workflows/update-flake-lock.yml
vendored
|
@ -2,7 +2,7 @@ name: update-flake-lock
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # allows manual triggering
|
workflow_dispatch: # allows manual triggering
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
|
- cron: '0 0 * * 1,4' # Run twice a week
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lockfile:
|
lockfile:
|
||||||
|
|
Loading…
Reference in a new issue