Merge pull request #67 from replit/gui/implement-nix-ci
Implement Nix in CircleCI
commitbaf2c247914d3b9e77956dbe3bd67174e052af81
authorGuillaume St-Pierre <gstpierre01@gmail.com>
dateFri 2 Jul 2021, 09:47 (5 years ago)
parent27ea088d352494
.circleci/config.yml+23
@@ -14,6 +14,25 @@ jobs:
1414 - checkout
1515 - setup_remote_docker
1616 - run: make test-image
17+ nix_build:
18+ docker:
19+ - image: nixos/nix
20+ steps:
21+ - checkout
22+ - restore_cache:
23+ key: nix-store
24+ - run:
25+ # Skipping the julia and closure tests for now since they break in CI
26+ name: Run nix build
27+ command: |
28+ mv ./tests/julia ./tests/julia_skip
29+ mv ./tests/clojure ./tests/clojure_skip
30+ nix-build
31+ - save_cache:
32+ key: nix-store
33+ when: always
34+ paths:
35+ - /nix
1736 build_test_and_deploy:
1837 docker:
1938 - image: docker:18.09
@@ -43,6 +62,10 @@ workflows:
4362 filters:
4463 branches:
4564 ignore: master
65+ - nix_build:
66+ filters:
67+ branches:
68+ ignore: master
4669 - build_test_and_deploy:
4770 context: Docker Hub
4871 filters:
build-prybar.nix+1−2
@@ -45,7 +45,6 @@ in buildGoModule {
4545 # The test file expect the binary to be in the current directory rather than bin
4646 preCheck = ''
4747 cp $GOPATH/bin/${language} ./prybar-${language}
48− ln -s ${expect} /usr
4948 '';
5049
5150 # Add all the dependencies to the check. Binaries should include the language interpreter/binaries
@@ -56,7 +55,7 @@ in buildGoModule {
5655 checkPhase = ''
5756 runHook preCheck
5857
59− ${bash}/bin/bash ./run_tests_language ${language}
58+ "${bash}/bin/bash" "./run_tests_language" "${language}" "${expect}/bin"
6059
6160 runHook postCheck
6261 '';
default.nix+1
@@ -19,6 +19,7 @@ in
1919 buildInputs = [ julia ];
2020 versionArg = versionArg;
2121 setFlags = true;
22+ binaries = [ pkgs.zlib ];
2223 };
2324
2425 prybar-nodejs = buildPrybar { language = "nodejs"; binaries = [ pkgs.nodejs ]; versionArg = versionArg; };
run_tests_language+2
@@ -4,6 +4,7 @@ stty cols 80
44stty rows 20
55
66language=$1
7+expect_path=$2
78tests=$(find "./tests/${language}" -printf '%P\n')
89
910for t in ${tests}; do
@@ -16,6 +17,7 @@ for t in ${tests}; do
1617
1718 echo -n "... ${language} $name"
1819
20+ sed -i "s;#!/usr/bin/expect;#!${expect_path}/expect;" "./tests/${language}/$t"
1921 test_out=$(timeout 15 "./tests/${language}/$t" 2>&1)
2022 if [[ $? != 0 ]]; then
2123 echo -e "\n========== \"$t\" failed =========="