ci: split nix-build-test into nix-build nix-test and introduce circleci contexts

This commit is contained in:
Wolfgang Walther
2021-04-16 14:10:49 +02:00
committed by Wolfgang Walther
parent 4b46c4eff3
commit 67e3886547
+32 -4
View File
@@ -156,8 +156,8 @@ jobs:
postgrest-release-dockerhubdescription postgrest-release-dockerhubdescription
fi fi
# Build everything in default.nix, push to the Cachix binary cache and run tests # Build everything in default.nix and push to the Cachix binary cache if running on main
nix-build-test: nix-build:
machine: true machine: true
steps: steps:
- checkout - checkout
@@ -191,6 +191,22 @@ jobs:
echo "Building all derivations (caching skipped for outside pull requests)..." echo "Building all derivations (caching skipped for outside pull requests)..."
nix-build nix-build
fi fi
# Run tests
nix-test:
machine: true
steps:
- checkout
- run:
name: Install Nix
command: |
curl -L https://nixos.org/nix/install | sh
echo "source $HOME/.nix-profile/etc/profile.d/nix.sh" >> $BASH_ENV
- run:
name: Install and use the Cachix binary cache
command: |
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use postgrest
- run: - run:
name: Install testing scripts name: Install testing scripts
command: nix-env -f default.nix -iA tests tests.memoryTests command: nix-env -f default.nix -iA tests tests.memoryTests
@@ -261,7 +277,15 @@ workflows:
only: only:
- /v[0-9]+(\.[0-9]+)*/ - /v[0-9]+(\.[0-9]+)*/
- nightly - nightly
- nix-build-test: - nix-build:
filters:
tags:
only:
- /v[0-9]+(\.[0-9]+)*/
- nightly
context:
- cachix
- nix-test:
filters: filters:
tags: tags:
only: only:
@@ -272,7 +296,8 @@ workflows:
- style-check - style-check
- stack-test - stack-test
- stack-test-memory - stack-test-memory
- nix-build-test - nix-build
- nix-test
filters: filters:
tags: tags:
only: only:
@@ -280,3 +305,6 @@ workflows:
- nightly - nightly
branches: branches:
ignore: /.*/ ignore: /.*/
context:
- docker
- github