2020-03-13 10:57:58 +00:00
|
|
|
name: "Test"
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
|
|
|
tests:
|
2021-09-01 23:08:38 +00:00
|
|
|
needs: [check_cachix]
|
2020-03-13 10:57:58 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-05-15 08:06:14 +00:00
|
|
|
os: [ubuntu-latest, macos-latest]
|
2020-03-13 10:57:58 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-02-25 22:12:51 +00:00
|
|
|
|
2020-03-13 10:57:58 +00:00
|
|
|
steps:
|
2021-10-18 22:01:24 +00:00
|
|
|
- uses: actions/checkout@v2.3.5
|
2020-03-13 16:25:47 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-09-14 12:57:56 +00:00
|
|
|
- uses: cachix/install-nix-action@v14
|
2021-02-25 22:12:51 +00:00
|
|
|
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
|
2021-04-12 05:21:11 +00:00
|
|
|
- uses: cachix/cachix-action@v10
|
2021-09-01 23:08:38 +00:00
|
|
|
if: needs.check_cachix.outputs.secret == 'true'
|
2021-02-15 10:20:54 +00:00
|
|
|
with:
|
|
|
|
name: '${{ env.CACHIX_NAME }}'
|
|
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
2021-02-25 22:12:51 +00:00
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
2021-06-28 21:02:53 +00:00
|
|
|
- run: nix-build -A checks.$(nix-instantiate --eval -E '(builtins.currentSystem)')
|
2021-02-25 22:12:51 +00:00
|
|
|
check_cachix:
|
|
|
|
name: Cachix secret present for installer tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
secret: ${{ steps.secret.outputs.secret }}
|
|
|
|
steps:
|
|
|
|
- name: Check for Cachix secret
|
|
|
|
id: secret
|
|
|
|
env:
|
|
|
|
_CACHIX_SECRETS: ${{ secrets.CACHIX_SIGNING_KEY }}${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
|
|
run: echo "::set-output name=secret::${{ env._CACHIX_SECRETS != '' }}"
|
2021-02-15 10:20:54 +00:00
|
|
|
installer:
|
2021-02-25 22:12:51 +00:00
|
|
|
needs: [tests, check_cachix]
|
|
|
|
if: github.event_name == 'push' && needs.check_cachix.outputs.secret == 'true'
|
2021-02-15 10:20:54 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
installerURL: ${{ steps.prepare-installer.outputs.installerURL }}
|
|
|
|
steps:
|
2021-10-18 22:01:24 +00:00
|
|
|
- uses: actions/checkout@v2.3.5
|
2021-02-15 10:20:54 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-02-25 22:12:51 +00:00
|
|
|
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
|
2021-09-14 12:57:56 +00:00
|
|
|
- uses: cachix/install-nix-action@v14
|
2021-04-12 05:21:11 +00:00
|
|
|
- uses: cachix/cachix-action@v10
|
2021-02-15 10:20:54 +00:00
|
|
|
with:
|
|
|
|
name: '${{ env.CACHIX_NAME }}'
|
|
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
2021-02-25 22:12:51 +00:00
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
2021-02-15 10:20:54 +00:00
|
|
|
- id: prepare-installer
|
|
|
|
run: scripts/prepare-installer-for-github-actions
|
|
|
|
installer_test:
|
2021-02-25 22:12:51 +00:00
|
|
|
needs: [installer, check_cachix]
|
|
|
|
if: github.event_name == 'push' && needs.check_cachix.outputs.secret == 'true'
|
2021-02-15 10:20:54 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2021-10-18 22:01:24 +00:00
|
|
|
- uses: actions/checkout@v2.3.5
|
2021-02-25 22:12:51 +00:00
|
|
|
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
|
2021-09-14 12:57:56 +00:00
|
|
|
- uses: cachix/install-nix-action@v14
|
2021-02-15 10:20:54 +00:00
|
|
|
with:
|
|
|
|
install_url: '${{needs.installer.outputs.installerURL}}'
|
2021-02-25 22:12:51 +00:00
|
|
|
install_options: "--tarball-url-prefix https://${{ env.CACHIX_NAME }}.cachix.org/serve"
|
2021-02-15 10:20:54 +00:00
|
|
|
- run: nix-instantiate -E 'builtins.currentTime' --eval
|