-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 1.96 KB
/
Copy pathcache.yml
File metadata and controls
58 lines (53 loc) · 1.96 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
name: "Cache"
on:
pull_request:
push:
branches:
- "main"
concurrency:
group: ${{ github.ref }}-cache
cancel-in-progress: true
jobs:
# idea credit: https://github.com/nix-community/nix-github-actions/blob/bfeb681177b5128d061ebbef7ded30bc21a3f135/.github/workflows/detsys-nix-installer-action.yml
matrix:
name: Calculate recent-versions matrix
runs-on: ubuntu-latest
outputs:
calculated: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: NixOS/nix-installer-action@main
- name: Set Matrix
id: set-matrix
run: |
set -eux -o pipefail
echo "matrix=$(nix eval --json '.#lib.recentMatrix')" >> "$GITHUB_OUTPUT"
packages:
name: Cache ${{ matrix.elixir }} on OTP ${{ matrix.erlang }} (${{ matrix.os }})
needs: matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.matrix.outputs.calculated) }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
with:
extra_nix_config: |
extra-substituters = https://nix-beam-flakes.cachix.org
extra-trusted-public-keys = nix-beam-flakes.cachix.org-1:iRMzLmb/dZFw7v08Rp3waYlWqYZ8nR3fmtFwq2prdk4=
accept-flake-config = true
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
if: github.ref == 'refs/heads/main'
with:
name: nix-beam-flakes
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
pathsToPush: "./result"
useDaemon: false
cachixArgs: --verbose
- run: |
printf \
"elixir %s\nerlang %s" \
${{ matrix.elixir }} \
${{ matrix.erlang }} \
| tee ./dev/example/.tool-versions
- run: nix -L build .#example