use shellexpand-utils #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Cache Nix store | |
uses: actions/cache@v3 | |
id: nix-cache | |
with: | |
path: /tmp/nix-cache | |
key: nix-${{ hashFiles('**/*.nix') }} | |
- name: Cache Cargo target folder | |
uses: actions/cache@v3 | |
with: | |
path: '**/target/debug' | |
key: cargo-debug-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install Nix | |
uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-22.11 | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
- name: Import Nix store cache | |
if: ${{ steps.nix-cache.outputs.cache-hit == 'true' }} | |
run: nix-store --import < /tmp/nix-cache | |
- name: Run tests | |
run: nix develop -c cargo test --all-features | |
- name: Export Nix store cache | |
if: ${{ steps.nix-cache.outputs.cache-hit != 'true' }} | |
run: nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nix-cache |