mirror of
https://github.com/Mic92/sops-nix.git
synced 2026-01-10 15:42:39 +08:00
parallelize CI
This commit is contained in:
parent
5505789e4a
commit
c7826f534e
7 changed files with 87 additions and 23 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, buildGoModule, path, pkgs, vendorSha256 }:
|
||||
{ stdenv, buildGoModule, path, pkgs, vendorSha256, go }:
|
||||
buildGoModule {
|
||||
pname = "sops-install-secrets";
|
||||
version = "0.0.1";
|
||||
|
|
@ -15,6 +15,14 @@ buildGoModule {
|
|||
inherit pkgs;
|
||||
};
|
||||
|
||||
outputs = [ "out" "unittest" ];
|
||||
|
||||
postBuild = ''
|
||||
go test -c ./pkgs/sops-install-secrets
|
||||
install -D ./sops-install-secrets.test $unittest/bin/sops-install-secrets.test
|
||||
remove-references-to -t ${go} $unittest/bin/sops-install-secrets.test
|
||||
'';
|
||||
|
||||
inherit vendorSha256;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ func writeManifest(t *testing.T, dir string, m *manifest) string {
|
|||
}
|
||||
|
||||
func testAssetPath() string {
|
||||
assets := os.Getenv("TEST_ASSETS")
|
||||
if assets != "" {
|
||||
return assets
|
||||
}
|
||||
_, filename, _, _ := runtime.Caller(0)
|
||||
return path.Join(path.Dir(filename), "test-assets")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, makeSetupHook, gnupg, sops, go, nix }:
|
||||
{ stdenv, makeSetupHook, gnupg, sops, nix }:
|
||||
|
||||
(makeSetupHook {
|
||||
substitutions = {
|
||||
|
|
|
|||
|
|
@ -23,8 +23,11 @@ func ok(tb testing.TB, err error) {
|
|||
}
|
||||
|
||||
func TestShellHook(t *testing.T) {
|
||||
_, filename, _, _ := runtime.Caller(0)
|
||||
assets := path.Join(path.Dir(filename), "test-assets")
|
||||
assets := os.Getenv("TEST_ASSETS")
|
||||
if assets == "" {
|
||||
_, filename, _, _ := runtime.Caller(0)
|
||||
assets = path.Join(path.Dir(filename), "test-assets")
|
||||
}
|
||||
tempdir, err := ioutil.TempDir("", "testdir")
|
||||
ok(t, err)
|
||||
defer os.RemoveAll(tempdir)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue