-
Notifications
You must be signed in to change notification settings - Fork 604
93 lines (80 loc) · 2.37 KB
/
nix.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Nix
on:
push:
paths-ignore:
- "docs/**"
- "**/*.md"
- "**/*.qmd"
- ".envrc"
branches:
- main
- "*.x.x"
pull_request:
paths-ignore:
- "docs/**"
- "**/*.md"
- "**/*.qmd"
- ".envrc"
branches:
- main
- "*.x.x"
merge_group:
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
nix:
runs-on: ${{ matrix.os }}
name: nix (${{ matrix.os }}, ${{ matrix.python-version }})
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest # x86_64-linux
- ubuntu-arm64-24.04 # aarch64-linux
- macos-13 # x86_64-darwin
- macos-14 # aarch64-darwin
python-version:
- "3.12"
- "3.13"
include:
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.11"
steps:
- name: checkout
uses: actions/checkout@v4
- name: install nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable-small
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: setup cachix
uses: cachix/cachix-action@v15
with:
name: ibis
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community
- name: nix build environment
run: |
set -euo pipefail
version='${{ matrix.python-version }}'
nix build ".#ibis${version//./}" --fallback --keep-going --print-build-logs
- name: nix test
run: |
set -euo pipefail
version='${{ matrix.python-version }}'
nix build ".#ibis${version//./}.passthru.tests.pytest" --fallback --keep-going --print-build-logs
- name: nix build devShell
run: |
set -euo pipefail
version='${{ matrix.python-version }}'
host_system="$(nix eval --raw 'nixpkgs#stdenv.hostPlatform.system')"
flake=".#devShells.${host_system}.ibis${version//./}"
args=("--fallback" "--keep-going" "--print-build-logs")
if [[ "${{ github.event_name }}" != "push" ]]; then
args+=("--dry-run")
fi
nix build "$flake" "${args[@]}"