This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
60 lines (57 loc) · 1.79 KB
/
cache.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
name: "Cache"
on:
pull_request:
push:
branches:
- "develop"
- "feature/ci"
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@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
diagnostic-endpoint: ""
- 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 }}
needs: matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.matrix.outputs.calculated) }}
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
diagnostic-endpoint: ""
- uses: DeterminateSystems/magic-nix-cache-action@v2
with:
diagnostic-endpoint: ""
- uses: cachix/cachix-action@v13
if: github.ref == 'refs/heads/develop'
with:
name: shanesveller-nix-beam-flakes
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
pathsToPush: "./result"
skipAddingSubstituter: true
- run: |
printf \
"elixir %s\nerlang %s" \
${{ matrix.elixir }} \
${{ matrix.erlang }} \
| tee ./dev/example/.tool-versions
- run: nix -L build .#example