-
Notifications
You must be signed in to change notification settings - Fork 96
58 lines (58 loc) · 1.47 KB
/
checks.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
name: checks
on:
push:
branches:
- develop
pull_request:
branches:
- develop
permissions:
contents: read
jobs:
rake-ci:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ruby-version:
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '3.0'
- '3.1'
- '3.2'
- '3.3'
runs-on: ${{ matrix.os }}
env:
nixfile: "contrib/nix/ruby${{ matrix.ruby-version }}-shell.nix"
steps:
- name: Check out source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache nix store
uses: actions/cache@v3
id: nix-cache
with:
path: /tmp/nixcache
key: nix-store-${{ matrix.os }}-ruby${{ matrix.ruby-version }}-${{ hashFiles('contrib/nix/**') }}
restore-keys: |
nix-store-${{ matrix.os }}-ruby${{ matrix.ruby-version }}-
nix-store-
- name: Install bash on MacOS
run: brew install bash
if: runner.os == 'macOS'
- name: Install nix
uses: nixbuild/nix-quick-install-action@v21
- name: Import nix cache
run: |
if [ -f /tmp/nixcache ] ; then
nix-store --import </tmp/nixcache
fi
- name: Run Rake ci task
run: nix-shell "$nixfile" --run 'rake ci'
- name: Export nix cache
run: nix-store --export $(nix-store -qR $(nix-build --no-out-link "$nixfile" -A inputDerivation | tail -n1)) >/tmp/nixcache