Simplify Nix CI jobs
This commit is contained in:
committed by
Steve Chavez
parent
99ecc7af70
commit
2eb8083869
+10
-51
@@ -153,12 +153,16 @@ jobs:
|
|||||||
postgrest-release-dockerhub
|
postgrest-release-dockerhub
|
||||||
postgrest-release-dockerhubdescription
|
postgrest-release-dockerhubdescription
|
||||||
|
|
||||||
# Build everything in default.nix and push to the Cachix binary cache.
|
# Build everything in default.nix, push to the Cachix binary cache and run tests
|
||||||
nix-build:
|
nix-build-test:
|
||||||
docker:
|
machine: true
|
||||||
- image: nixos/nix:2.3
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- 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:
|
- run:
|
||||||
name: Install and use the Cachix binary cache
|
name: Install and use the Cachix binary cache
|
||||||
command: |
|
command: |
|
||||||
@@ -176,42 +180,9 @@ 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 against all supported PostgreSQL versions.
|
|
||||||
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.ioTests tests.memoryTests
|
command: nix-env -f default.nix -iA tests tests.ioTests tests.memoryTests
|
||||||
# Our utility scripts use cabal to run the tests, which will pick up all
|
|
||||||
# the libraries that are built with Nix. So this should only ever build
|
|
||||||
# the PostgREST itself and be reasonably quick. We accelerate that part
|
|
||||||
# further by caching `~/.cabal` and `dist-newstyle`.
|
|
||||||
#
|
|
||||||
# CircleCI looks for caches by prefix. When saving to the the cache
|
|
||||||
# below, we append the current time to the key ('-{{ epoch }}'), so a new
|
|
||||||
# cache will always be uploaded. If the `postgrest.cabal` and
|
|
||||||
# `nix/nixpkgs-version.nix` files are unchanged, the latest matching
|
|
||||||
# cache will be used. If there is no cache for those files, CircleCI will
|
|
||||||
# try the next, more general key and use the latest cache that matches
|
|
||||||
# it.
|
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- nix-test-{{ checksum "postgrest.cabal" }}-{{ checksum "nix/nixpkgs-version.nix" }}
|
|
||||||
- nix-test-{{ checksum "postgrest.cabal" }}
|
|
||||||
- nix-test
|
|
||||||
- run:
|
- run:
|
||||||
name: Run the spec tests against PostgreSQL 9.4
|
name: Run the spec tests against PostgreSQL 9.4
|
||||||
command: postgrest-test-spec-postgresql-9.4
|
command: postgrest-test-spec-postgresql-9.4
|
||||||
@@ -239,11 +210,6 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Run memory tests
|
name: Run memory tests
|
||||||
command: postgrest-test-memory
|
command: postgrest-test-memory
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- "~/.cabal"
|
|
||||||
- "dist-newstyle"
|
|
||||||
key: nix-test-{{ checksum "postgrest.cabal" }}-{{ checksum "nix/nixpkgs-version.nix" }}-{{ epoch }}
|
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
@@ -262,23 +228,16 @@ workflows:
|
|||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /v[0-9]+(\.[0-9]+)*/
|
only: /v[0-9]+(\.[0-9]+)*/
|
||||||
- nix-build:
|
- nix-build-test:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /v[0-9]+(\.[0-9]+)*/
|
only: /v[0-9]+(\.[0-9]+)*/
|
||||||
- nix-test:
|
|
||||||
filters:
|
|
||||||
tags:
|
|
||||||
only: /v[0-9]+(\.[0-9]+)*/
|
|
||||||
requires:
|
|
||||||
- nix-build
|
|
||||||
- release:
|
- release:
|
||||||
requires:
|
requires:
|
||||||
- style-check
|
- style-check
|
||||||
- stack-test
|
- stack-test
|
||||||
- stack-test-memory
|
- stack-test-memory
|
||||||
- nix-build
|
- nix-build-test
|
||||||
- nix-test
|
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /v[0-9]+(\.[0-9]+)*/
|
only: /v[0-9]+(\.[0-9]+)*/
|
||||||
|
|||||||
Reference in New Issue
Block a user