Add Nix builds for the full registry #1767
Workflow file for this run
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: | |
push: | |
branches: [master] | |
pull_request: | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SPACES_KEY: ${{ secrets.SPACES_KEY }} | |
SPACES_SECRET: ${{ secrets.SPACES_SECRET }} | |
steps: | |
# Setup | |
- name: Check out source repository | |
uses: actions/checkout@v2 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@v4 | |
with: | |
github-token: ${{ env.GITHUB_TOKEN }} | |
- name: Setup Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@v2 | |
# Separates all the cache downloading time from the time required to actually run a step | |
# of the workflow | |
- name: Initialize Nix | |
run: nix develop | |
# First we build the two packages that represent the build outputs of the | |
# registry for general consumers | |
- name: Build the registry server | |
run: nix build .#server | |
- name: Build the registry GitHub importer | |
run: nix build .#github-importer | |
# Then we run the flake checks, which will build all packages and scripts | |
# in the registry, and will also run tests and check formatting. | |
- name: Run flake checks | |
run: nix flake check | |
# Unfortunately I can't run 'spago test' in a derivation because it doesn't | |
# have a mode that ignores the cache | |
- name: Run Spago tests | |
run: nix develop --command run-tests-script |