.github/workflows/checks.yml (1966B) - raw
1 name: checks
2 on:
3 push:
4 branches:
5 - develop
6 pull_request:
7 branches:
8 - develop
9 permissions:
10 contents: read
11 jobs:
12 rake-ci:
13 strategy:
14 fail-fast: false
15 matrix:
16 os:
17 - ubuntu-latest
18 - macos-15
19 ruby-version:
20 - '2.4'
21 - '2.5'
22 - '2.6'
23 - '2.7'
24 - '3.0'
25 - '3.1'
26 - '3.2'
27 - '3.3'
28 - '3.4'
29 - '4.0'
30 exclude:
31 # We use xapian-bindings 1.4.22 for Ruby < 3.1, but it does not link on MacOS 14:
32 # https://github.com/Garaio-REM/xapian-ruby/issues/10
33 - os: macos-15
34 ruby-version: '2.4'
35 - os: macos-15
36 ruby-version: '2.5'
37 - os: macos-15
38 ruby-version: '2.6'
39 - os: macos-15
40 ruby-version: '2.7'
41 - os: macos-15
42 ruby-version: '3.0'
43 runs-on: ${{ matrix.os }}
44 env:
45 nixfile: "contrib/nix/ruby${{ matrix.ruby-version }}-shell.nix"
46 steps:
47 - name: Check out source
48 uses: actions/checkout@v5
49 with:
50 submodules: recursive
51 - name: Cache nix store
52 uses: actions/cache@v5
53 id: nix-cache
54 with:
55 path: /tmp/nixcache
56 key: nix-store-${{ matrix.os }}-ruby${{ matrix.ruby-version }}-${{ hashFiles('contrib/nix/**') }}
57 restore-keys: |
58 nix-store-${{ matrix.os }}-ruby${{ matrix.ruby-version }}-
59 nix-store-
60 - name: Install bash on MacOS
61 run: brew install bash
62 if: runner.os == 'macOS'
63 - name: Install nix
64 uses: nixbuild/nix-quick-install-action@v34
65 - name: Import nix cache
66 run: |
67 if [ -f /tmp/nixcache ] ; then
68 nix-store --import </tmp/nixcache
69 fi
70 - name: Run Rake ci task
71 run: nix-shell "$nixfile" --run 'rake ci'
72 - name: Export nix cache
73 run: nix-store --export $(nix-store -qR $(nix-build --no-out-link "$nixfile" -A inputDerivation | tail -n1)) >/tmp/nixcache