Skip to content

contrib/nix: add a shell.nix for testing 'gem install' #42

contrib/nix: add a shell.nix for testing 'gem install'

contrib/nix: add a shell.nix for testing 'gem install' #42

Workflow file for this run

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