Skip to content

Commit

Permalink
Merge pull request #17 from Mic92/ci-fix
Browse files Browse the repository at this point in the history
tests: use pure nix-shell
  • Loading branch information
Mic92 authored Aug 25, 2020
2 parents a0fb614 + 0fd2382 commit 563ae35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
- run:
nix-build
- run:
nix-shell --run 'go test'
nix-shell --pure --run "NIX_SSL_CERT_FILE=$NIX_SSL_CERT_FILE go test"
- run:
nix run nixpkgs.gox -c gox -os '!windows' .
5 changes: 5 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ buildGoModule {
--prefix PATH ":" ${lib.makeBinPath [ nix ]}
'';

shellHook = ''
# needed for tests
export PATH=$PATH:${lib.makeBinPath [ nix ]}
'';

# requires nix, which we do not have in the sandbox
doCheck = false;

Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func buildNixFile(t testing.TB, tempdir string, nixFile string, expectedBuilds i
err := os.MkdirAll(output, 0700)
ok(t, err)

buildFlags := fmt.Sprintf("--store '%s' -o '%s'", store, path.Join(output, "result"))
buildFlags := fmt.Sprintf("-I nixpkgs=channel:nixos-unstable-small --store '%s' -o '%s'", store, path.Join(output, "result"))
flags := []string{"-build-flags", buildFlags, nixFile}
fmt.Printf("nix-build-uncached %s\n", strings.Join(flags, " "))
err = realMain(flags)
Expand Down

0 comments on commit 563ae35

Please sign in to comment.