2020-03-13 11:57:58 +01:00
|
|
|
name: "Test"
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-05-15 10:06:14 +02:00
|
|
|
os: [ubuntu-latest, macos-latest]
|
2020-03-13 11:57:58 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-02-15 11:20:54 +01:00
|
|
|
env:
|
|
|
|
CACHIX_NAME: nix-ci
|
2020-03-13 11:57:58 +01:00
|
|
|
steps:
|
2021-02-15 11:20:54 +01:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2020-03-13 17:25:47 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-11-10 00:21:55 +01:00
|
|
|
- uses: cachix/install-nix-action@v12
|
2021-02-15 11:20:54 +01:00
|
|
|
- uses: cachix/cachix-action@v8
|
|
|
|
with:
|
|
|
|
name: '${{ env.CACHIX_NAME }}'
|
|
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
2020-03-13 17:13:54 +01:00
|
|
|
#- run: nix flake check
|
|
|
|
- run: nix-build -A checks.$(if [[ `uname` = Linux ]]; then echo x86_64-linux; else echo x86_64-darwin; fi)
|
2021-02-15 11:20:54 +01:00
|
|
|
installer:
|
|
|
|
if: github.event_name == 'push'
|
|
|
|
needs: tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
CACHIX_NAME: nix-ci
|
|
|
|
outputs:
|
|
|
|
installerURL: ${{ steps.prepare-installer.outputs.installerURL }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2.3.4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- uses: cachix/install-nix-action@v12
|
|
|
|
- uses: cachix/cachix-action@v8
|
|
|
|
with:
|
|
|
|
name: '${{ env.CACHIX_NAME }}'
|
|
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
|
|
|
- id: prepare-installer
|
|
|
|
run: scripts/prepare-installer-for-github-actions
|
|
|
|
installer_test:
|
|
|
|
if: github.event_name == 'push'
|
|
|
|
needs: installer
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
env:
|
|
|
|
CACHIX_NAME: nix-ci
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2.3.4
|
|
|
|
- uses: cachix/install-nix-action@master
|
|
|
|
with:
|
|
|
|
install_url: '${{needs.installer.outputs.installerURL}}'
|
|
|
|
install_options: '--tarball-url-prefix https://${{ env.CACHIX_NAME }}.cachix.org/serve'
|
|
|
|
- run: nix-instantiate -E 'builtins.currentTime' --eval
|
|
|
|
|