Repository navigation
77 lines (67 loc) · 2.48 KB
/
Copy pathci.yml
File metadata and controls
77 lines (67 loc) · 2.48 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
schedule:
# Exercise the full builds that pushes only evaluate.
- cron: "0 5 * * 1"
workflow_dispatch:
inputs:
build_homes:
description: Build both Home Manager configurations
required: false
default: false
type: boolean
permissions:
contents: read
# cache-nix-action purges superseded cache entries through the Actions API,
# which needs write access; without it the purge inputs below are inert.
actions: write
concurrency:
group:
${{ github.workflow }}-${{ github.ref_name != 'main' && github.ref ||
github.run_id }}
cancel-in-progress: true
jobs:
checks:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Nix
uses: cachix/install-nix-action@75c75c31ebece974e48ebc36b4ad125bd97bd97b # v31.11.3
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Restore the Nix store
uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.2
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
# The closure exceeds the 10 GB per-repository cache limit, so trim
# it on save and keep only the newest entry for this prefix.
gc-max-store-size-linux: 8G
purge: true
purge-prefixes: nix-${{ runner.os }}-
purge-created: 0
purge-primary-key: never
- name: Run flake checks
run: nix flake check --show-trace --no-update-lock-file
- name: Evaluate Home Manager configurations
run: |
nix eval --no-update-lock-file --raw .#homeConfigurations.schan.activationPackage.drvPath
printf '\n'
nix eval --no-update-lock-file --raw .#homeConfigurations.stachan.activationPackage.drvPath
printf '\n'
- name: Build Home Manager configurations
if:
${{ github.event_name == 'schedule' || (github.event_name ==
'workflow_dispatch' && inputs.build_homes) }}
run: |
nix build --no-link --print-build-logs \
--no-update-lock-file \
.#homeConfigurations.schan.activationPackage \
.#homeConfigurations.stachan.activationPackage