diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..1d953f4b --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 654aa8f4..06adbc75 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -45,8 +45,10 @@ jobs: - uses: cachix/install-nix-action@v22 - uses: rrbutani/use-nix-shell-action@v1.1.0 + env: + HOME: /home/runner with: - file: shell.nix + file: shell.nix - name: Check if the chart follows a valid semver version run: | diff --git a/.gitignore b/.gitignore index e93a89e1..84c1ce12 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tags *.swn *.idea *.test +coverage.txt diff --git a/docs/developer-setup.md b/docs/developer-setup.md index 15271a1d..450969f8 100644 --- a/docs/developer-setup.md +++ b/docs/developer-setup.md @@ -33,7 +33,7 @@ git remote -v ``` Install the build dependencies. - * Run `make bootstrap` to install the required Go tools + * Run `make bootstrap` to install the required Go tools, Nix users can run `nix-shell`, it will bring up a shell with required tools installed ## Git Development Workflow diff --git a/nix/.gitignore b/nix/.gitignore new file mode 100644 index 00000000..5a89bf48 --- /dev/null +++ b/nix/.gitignore @@ -0,0 +1,2 @@ +.go/ +.tmp/ diff --git a/shell.nix b/shell.nix index 54f411c0..d070f65a 100644 --- a/shell.nix +++ b/shell.nix @@ -5,8 +5,25 @@ in pkgs.mkShell { name = "scripts-shell"; buildInputs = with pkgs; [ + chart-testing + ginkgo + git + go_1_19 + golint + kubectl + kubernetes-helm + gnumake + minikube semver-tool yq-go - chart-testing ]; -} \ No newline at end of file + shellHook = '' + export HOME=${builtins.getEnv "HOME"} + export GOPATH=$(pwd)/nix/.go + export GOCACHE=$(pwd)/nix/.go/cache + export TMPDIR=$(pwd)/nix/.tmp + export PATH=$GOPATH/bin:$PATH + mkdir -p "$TMPDIR" + make bootstrap + ''; +}