From 6f2a4d45a3f1134f57911b7ce28dcc78c175832a Mon Sep 17 00:00:00 2001 From: Marcus Ramberg Date: Mon, 25 Nov 2024 13:51:20 +0100 Subject: [PATCH] chore: upgrade go deps, onboard renovate --- .github/codecov.yaml | 1 + default.nix | 43 +++++++++++++++++++++++++++++++------------ go.mod | 4 ++-- go.sum | 4 ++++ gomod2nix.toml | 8 ++++---- 5 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 .github/codecov.yaml diff --git a/.github/codecov.yaml b/.github/codecov.yaml new file mode 100644 index 0000000..8dfc929 --- /dev/null +++ b/.github/codecov.yaml @@ -0,0 +1 @@ +comment: true diff --git a/default.nix b/default.nix index c13e037..c5b87bb 100644 --- a/default.nix +++ b/default.nix @@ -1,24 +1,43 @@ -{ pkgs ? (let - inherit (builtins) fetchTree fromJSON readFile; - inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; -in import (fetchTree nixpkgs.locked) { - overlays = [ (import "${fetchTree gomod2nix.locked}/overlay.nix") ]; -}), buildGoApplication ? pkgs.buildGoApplication }: +{ + pkgs ? ( + let + inherit (builtins) fetchTree fromJSON readFile; + inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; + in + import (fetchTree nixpkgs.locked) { + overlays = [ (import "${fetchTree gomod2nix.locked}/overlay.nix") ]; + } + ), + buildGoApplication ? pkgs.buildGoApplication, +}: let - helmWrap = with pkgs; + helmWrap = + with pkgs; wrapHelm kubernetes-helm { - plugins = with kubernetes-helmPlugins; [ helm-diff helm-git ]; + plugins = with kubernetes-helmPlugins; [ + helm-diff + helm-git + ]; }; - helmfileWrap = - pkgs.helmfile-wrapped.override { inherit (helmWrap) pluginsDir; }; -in buildGoApplication { + helmfileWrap = pkgs.helmfile-wrapped.override { inherit (helmWrap) pluginsDir; }; +in +buildGoApplication { pname = "helmfile-nix"; version = "0.1"; pwd = ./.; src = ./.; - nativeBuildInputs = with pkgs; [ nix helmWrap helmfileWrap ]; + nativeBuildInputs = with pkgs; [ + nix + helmWrap + helmfileWrap + ]; modules = ./gomod2nix.toml; preCheck = '' export HOME=$TMPDIR + go test -coverprofile=coverage.txt -v 2>&1 ./... | ${pkgs.go-junit-report}/bin/go-junit-report > report.xml + ls -l + mkdir -p $out + cp report.xml coverage.txt $out/ ''; + postCheck = ''''; } diff --git a/go.mod b/go.mod index 41f00b5..7e81145 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/reMarkable/cloud-shared-services/helmfile-nix go 1.22.1 require ( - github.com/jessevdk/go-flags v1.5.0 + github.com/jessevdk/go-flags v1.6.1 gopkg.in/yaml.v3 v3.0.1 ) @@ -11,5 +11,5 @@ require github.com/sergi/go-diff v1.3.1 // indirect require ( github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 - golang.org/x/sys v0.19.0 // indirect + golang.org/x/sys v0.27.0 // indirect ) diff --git a/go.sum b/go.sum index c70827d..a84a7bd 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bBK4= +github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -20,6 +22,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/gomod2nix.toml b/gomod2nix.toml index b30681f..058787c 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -5,14 +5,14 @@ schema = 3 version = "v0.0.0-20170406064948-c7f18ee00883" hash = "sha256-2XoKB20lN+KGnAb/eVv1NcU/CcSdUPcvVNiXF/uUmOg=" [mod."github.com/jessevdk/go-flags"] - version = "v1.5.0" - hash = "sha256-3VCQpnUCZhjmjjdOZ2SKrUbDR5gUkYuNADNWzFhZLX8=" + version = "v1.6.1" + hash = "sha256-Q5WFTgRxYio0+ay3sbQeBPKeJAFvOdiDVkaTVn3hoTA=" [mod."github.com/sergi/go-diff"] version = "v1.3.1" hash = "sha256-XLA/BLIPuUU76yikXqIeRSXr7T7A3Uz6I27+mDxGj7w=" [mod."golang.org/x/sys"] - version = "v0.19.0" - hash = "sha256-cmuL31TYLJmDm/fDnI2Sn0wB88cpdOHV1+urorsJWx4=" + version = "v0.27.0" + hash = "sha256-BXQcF9RrJ55Pq7Nl67TeFGkgkyuKkQ8hHKN4/L4ggWc=" [mod."gopkg.in/yaml.v3"] version = "v3.0.1" hash = "sha256-FqL9TKYJ0XkNwJFnq9j0VvJ5ZUU1RvH/52h/f5bkYAU="