From 99203615e8eaaeeb2ef982e44f6aa82956148cd4 Mon Sep 17 00:00:00 2001 From: Horiodino Date: Sun, 2 Jun 2024 10:58:54 +0530 Subject: [PATCH 1/5] taskfile ci integration Signed-off-by: Horiodino --- .github/workflows/test.yml | 24 +++++ .golangci.yml | 14 +++ Taskfile.yml | 12 +++ bsf.hcl | 9 +- bsf.lock | 203 ++++++++++++++++++++++--------------- bsf/flake.lock | 29 ++---- bsf/flake.nix | 33 +++--- 7 files changed, 200 insertions(+), 124 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 .golangci.yml create mode 100644 Taskfile.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..eeaf15b3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: Taskfile CI + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Install Nix + uses: cachix/install-nix-action@v17 + + - name: Install Task + uses: arduino/setup-task@v1 + + - name: go test + run: nix develop bsf/.#devShell --command task test + + - name: go lint + run: nix develop bsf/.#devShell --command task lint diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..6fa785e6 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,14 @@ +linters-settings: + deadcode: + skip-files: "_test\\.go$" + govet: + check-shadowing: false + golint: + exclude-use-default-exported: true + exclude-useless-naming: true + gosec: + tests: true + unused: + check-exported: true + check-blank: true + check-tests: true diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 00000000..4e09660a --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,12 @@ +version: '3' + +tasks: + test: + desc: "Run all Go tests" + cmds: + - go test ./... + + lint: + desc: "Run golangci-lint" + cmds: + - golangci-lint run diff --git a/bsf.hcl b/bsf.hcl index 07ca474b..fe97abff 100644 --- a/bsf.hcl +++ b/bsf.hcl @@ -1,12 +1,13 @@ packages { - development = ["go@1.22.0", "delve@^1.22.0", "gotools@~0.7.0", "goreleaser@^1.24.0"] + development = ["go@1.21.6", "gotools@0.16.1", "delve@1.22.0", "go-task@~3.37.2", "golangci-lint@~1.59.0"] runtime = ["cacert@3.95"] } gomodule { - name = "bsf" - src = "./." + name = "bsf" + src = "./." + ldFlags = null + tags = null doCheck = false } - diff --git a/bsf.lock b/bsf.lock index 0e0816d9..1a957a51 100644 --- a/bsf.lock +++ b/bsf.lock @@ -6,13 +6,13 @@ { "package": { "name": "go", - "revision": "5a7b241264578c55cd25aa7422121aef072ce588", - "version": "1.22.0", + "revision": "a731d0cb71c58f56895f71a5b02eda2962a46746", + "version": "1.21.6", "description": "The Go Programming language", "homepage": "https://go.dev/", "free": true, "spdx_id": "BSD-3-Clause", - "epoch_seconds": 1707509006, + "epoch_seconds": 1705066566, "platforms": [ "x86_64-darwin", "i686-darwin", @@ -39,21 +39,20 @@ "s390-linux", "s390x-linux", "x86_64-linux" - ], - "attr_name": "go_1_22" + ] }, "runtime": false }, { "package": { - "name": "goreleaser", - "revision": "5a7b241264578c55cd25aa7422121aef072ce588", - "version": "1.24.0", - "description": "Deliver Go binaries as fast and easily as possible", - "homepage": "https://goreleaser.com", + "name": "gotools", + "revision": "ac5c1886fd9fe49748d7ab80accc4c847481df14", + "version": "0.16.1", + "description": "Additional tools for Go development", + "homepage": "https://go.googlesource.com/tools", "free": true, - "spdx_id": "MIT", - "epoch_seconds": 1707509006, + "spdx_id": "BSD-3-Clause", + "epoch_seconds": 1699289668, "platforms": [ "x86_64-darwin", "i686-darwin", @@ -86,28 +85,19 @@ }, { "package": { - "name": "cacert", - "revision": "ac5c1886fd9fe49748d7ab80accc4c847481df14", - "version": "3.95", - "description": "A bundle of X.509 certificates of public Certificate Authorities (CA)", - "homepage": "https://curl.haxx.se/docs/caextract.html", + "name": "golangci-lint", + "revision": "7445ccd775d8b892fc56448d17345443a05f7fb4", + "version": "1.59.0", + "description": "Fast linters Runner for Go", + "homepage": "https://golangci-lint.run/", "free": true, - "spdx_id": "MPL-2.0", - "epoch_seconds": 1699289668, + "spdx_id": "GPL-3.0-or-later", + "epoch_seconds": 1716993062, "platforms": [ - "i686-cygwin", - "x86_64-cygwin", "x86_64-darwin", "i686-darwin", "aarch64-darwin", "armv7a-darwin", - "i686-freebsd13", - "x86_64-freebsd13", - "aarch64-genode", - "i686-genode", - "x86_64-genode", - "x86_64-solaris", - "javascript-ghcjs", "aarch64-linux", "armv5tel-linux", "armv6l-linux", @@ -129,61 +119,23 @@ "s390-linux", "s390x-linux", "x86_64-linux", - "mmix-mmixware", - "aarch64-netbsd", - "armv6l-netbsd", - "armv7a-netbsd", - "armv7l-netbsd", - "i686-netbsd", - "m68k-netbsd", - "mipsel-netbsd", - "powerpc-netbsd", - "riscv32-netbsd", - "riscv64-netbsd", - "x86_64-netbsd", - "aarch64_be-none", - "aarch64-none", - "arm-none", - "armv6l-none", - "avr-none", - "i686-none", - "microblaze-none", - "microblazeel-none", - "mips-none", - "mips64-none", - "msp430-none", - "or1k-none", - "m68k-none", - "powerpc-none", - "powerpcle-none", - "riscv32-none", - "riscv64-none", - "rx-none", - "s390-none", - "s390x-none", - "vc4-none", - "x86_64-none", - "i686-openbsd", - "x86_64-openbsd", - "x86_64-redox", "wasm64-wasi", - "wasm32-wasi", - "x86_64-windows", - "i686-windows" - ] + "wasm32-wasi" + ], + "attr_name": "golangci-lint" }, - "runtime": true + "runtime": false }, { "package": { - "name": "gotools", - "revision": "1ebb7d7bba2953a4223956cfb5f068b0095f84a7", - "version": "0.7.0", - "description": "Additional tools for Go development", - "homepage": "https://go.googlesource.com/tools", + "name": "go-task", + "revision": "7445ccd775d8b892fc56448d17345443a05f7fb4", + "version": "3.37.2", + "description": "A task runner / simpler Make alternative written in Go", + "homepage": "https://taskfile.dev/", "free": true, - "spdx_id": "BSD-3-Clause", - "epoch_seconds": 1653393815, + "spdx_id": "MIT", + "epoch_seconds": 1716993062, "platforms": [ "x86_64-darwin", "i686-darwin", @@ -209,8 +161,11 @@ "riscv64-linux", "s390-linux", "s390x-linux", - "x86_64-linux" - ] + "x86_64-linux", + "wasm64-wasi", + "wasm32-wasi" + ], + "attr_name": "go-task" }, "runtime": false }, @@ -253,6 +208,96 @@ ] }, "runtime": false + }, + { + "package": { + "name": "cacert", + "revision": "ac5c1886fd9fe49748d7ab80accc4c847481df14", + "version": "3.95", + "description": "A bundle of X.509 certificates of public Certificate Authorities (CA)", + "homepage": "https://curl.haxx.se/docs/caextract.html", + "free": true, + "spdx_id": "MPL-2.0", + "epoch_seconds": 1699289668, + "platforms": [ + "i686-cygwin", + "x86_64-cygwin", + "x86_64-darwin", + "i686-darwin", + "aarch64-darwin", + "armv7a-darwin", + "i686-freebsd13", + "x86_64-freebsd13", + "aarch64-genode", + "i686-genode", + "x86_64-genode", + "x86_64-solaris", + "javascript-ghcjs", + "aarch64-linux", + "armv5tel-linux", + "armv6l-linux", + "armv7a-linux", + "armv7l-linux", + "i686-linux", + "loongarch64-linux", + "m68k-linux", + "microblaze-linux", + "microblazeel-linux", + "mips-linux", + "mips64-linux", + "mips64el-linux", + "mipsel-linux", + "powerpc64-linux", + "powerpc64le-linux", + "riscv32-linux", + "riscv64-linux", + "s390-linux", + "s390x-linux", + "x86_64-linux", + "mmix-mmixware", + "aarch64-netbsd", + "armv6l-netbsd", + "armv7a-netbsd", + "armv7l-netbsd", + "i686-netbsd", + "m68k-netbsd", + "mipsel-netbsd", + "powerpc-netbsd", + "riscv32-netbsd", + "riscv64-netbsd", + "x86_64-netbsd", + "aarch64_be-none", + "aarch64-none", + "arm-none", + "armv6l-none", + "avr-none", + "i686-none", + "microblaze-none", + "microblazeel-none", + "mips-none", + "mips64-none", + "msp430-none", + "or1k-none", + "m68k-none", + "powerpc-none", + "powerpcle-none", + "riscv32-none", + "riscv64-none", + "rx-none", + "s390-none", + "s390x-none", + "vc4-none", + "x86_64-none", + "i686-openbsd", + "x86_64-openbsd", + "x86_64-redox", + "wasm64-wasi", + "wasm32-wasi", + "x86_64-windows", + "i686-windows" + ] + }, + "runtime": true } ] } \ No newline at end of file diff --git a/bsf/flake.lock b/bsf/flake.lock index 40cfd59f..acb310ea 100644 --- a/bsf/flake.lock +++ b/bsf/flake.lock @@ -55,35 +55,19 @@ "type": "github" } }, - "nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7": { + "nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4": { "locked": { - "lastModified": 1702939464, - "narHash": "sha256-mZqoH5fXxh8UxjUKpqi09UBXEPpz4w+2Ef0AVTLuF+g=", + "lastModified": 1716993062, + "narHash": "sha256-Q7+8FPD2V8OoGAe0d5LoE8HZ5KYJMyb80klPyrZj2hw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1ebb7d7bba2953a4223956cfb5f068b0095f84a7", + "rev": "7445ccd775d8b892fc56448d17345443a05f7fb4", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "1ebb7d7bba2953a4223956cfb5f068b0095f84a7", - "type": "github" - } - }, - "nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588": { - "locked": { - "lastModified": 1707509006, - "narHash": "sha256-aqLiIgNEZ6Fy96QXmeQaMK/E3lmmiS0qkRZ0arvHoj4=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "5a7b241264578c55cd25aa7422121aef072ce588", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "rev": "5a7b241264578c55cd25aa7422121aef072ce588", + "rev": "7445ccd775d8b892fc56448d17345443a05f7fb4", "type": "github" } }, @@ -123,8 +107,7 @@ "inputs": { "gomod2nix": "gomod2nix", "nixpkgs": "nixpkgs", - "nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7": "nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7", - "nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588": "nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588", + "nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4": "nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4", "nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746": "nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746", "nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14": "nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14" } diff --git a/bsf/flake.nix b/bsf/flake.nix index 941150cc..f4d1270f 100644 --- a/bsf/flake.nix +++ b/bsf/flake.nix @@ -4,9 +4,8 @@ inputs = { nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746.url = "github:nixos/nixpkgs/a731d0cb71c58f56895f71a5b02eda2962a46746"; - nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588.url = "github:nixos/nixpkgs/5a7b241264578c55cd25aa7422121aef072ce588"; nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14.url = "github:nixos/nixpkgs/ac5c1886fd9fe49748d7ab80accc4c847481df14"; - nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7.url = "github:nixos/nixpkgs/1ebb7d7bba2953a4223956cfb5f068b0095f84a7"; + nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4.url = "github:nixos/nixpkgs/7445ccd775d8b892fc56448d17345443a05f7fb4"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; gomod2nix.url = "github:nix-community/gomod2nix"; @@ -28,9 +27,8 @@ nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746, - nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14, - nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7, + nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4, }: let supportedSystems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" "aarch64-linux" ]; @@ -39,9 +37,8 @@ inherit system; nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs = import nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746 { inherit system; }; - nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588-pkgs = import nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588 { inherit system; }; nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs = import nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14 { inherit system; }; - nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs = import nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7 { inherit system; }; + nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs = import nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4 { inherit system; }; buildGoApplication = gomod2nix.legacyPackages.${system}.buildGoApplication; pkgs = import nixpkgs { inherit system; }; @@ -54,9 +51,8 @@ nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, - nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, - nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs, + nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { default = pkgs.callPackage ./default.nix { inherit buildGoApplication; @@ -73,17 +69,17 @@ nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, - nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, - nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs, + nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { devShell = pkgs.mkShell { # The Nix packages provided in the environment packages = [ nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs.delve - nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588-pkgs.go_1_22 - nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588-pkgs.goreleaser - nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs.gotools + nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs.go + nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.go-task + nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.golangci-lint + nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs.gotools ]; }; @@ -94,7 +90,7 @@ - nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs, ... }: { + nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { runtime = pkgs.buildEnv { name = "runtimeenv"; paths = [ @@ -109,14 +105,15 @@ - nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs, ... }: { + nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { development = pkgs.buildEnv { name = "devenv"; paths = [ nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs.delve - nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588-pkgs.go_1_22 - nixpkgs-5a7b241264578c55cd25aa7422121aef072ce588-pkgs.goreleaser - nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs.gotools + nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs.go + nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.go-task + nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.golangci-lint + nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs.gotools ]; }; From 2e20fc3f885290a17c0d9c13673f273575639f34 Mon Sep 17 00:00:00 2001 From: Horiodino Date: Sun, 2 Jun 2024 11:10:19 +0530 Subject: [PATCH 2/5] test branch Signed-off-by: Horiodino --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eeaf15b3..b0dd04eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: push: branches: - main - + - task-ci jobs: build: runs-on: ubuntu-latest From db964402cf60790ebbf90c15697f0013e337b3b3 Mon Sep 17 00:00:00 2001 From: Horiodino Date: Sun, 2 Jun 2024 14:09:44 +0530 Subject: [PATCH 3/5] fix after review Signed-off-by: Horiodino --- .github/workflows/test.yml | 9 +-- .golangci.yml | 14 ---- Taskfile.yml | 5 -- bsf.hcl | 2 +- bsf.lock | 147 +++++++++++++------------------------ bsf/flake.nix | 16 ++-- 6 files changed, 64 insertions(+), 129 deletions(-) delete mode 100644 .golangci.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0dd04eb..c9da3abf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,10 +15,9 @@ jobs: uses: cachix/install-nix-action@v17 - name: Install Task - uses: arduino/setup-task@v1 + uses: nicknovitski/nix-develop@v1 + with: + arguments: "bsf/.#devShell" - name: go test - run: nix develop bsf/.#devShell --command task test - - - name: go lint - run: nix develop bsf/.#devShell --command task lint + run: task test diff --git a/.golangci.yml b/.golangci.yml deleted file mode 100644 index 6fa785e6..00000000 --- a/.golangci.yml +++ /dev/null @@ -1,14 +0,0 @@ -linters-settings: - deadcode: - skip-files: "_test\\.go$" - govet: - check-shadowing: false - golint: - exclude-use-default-exported: true - exclude-useless-naming: true - gosec: - tests: true - unused: - check-exported: true - check-blank: true - check-tests: true diff --git a/Taskfile.yml b/Taskfile.yml index 4e09660a..683d8a0f 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -5,8 +5,3 @@ tasks: desc: "Run all Go tests" cmds: - go test ./... - - lint: - desc: "Run golangci-lint" - cmds: - - golangci-lint run diff --git a/bsf.hcl b/bsf.hcl index fe97abff..6c297881 100644 --- a/bsf.hcl +++ b/bsf.hcl @@ -1,6 +1,6 @@ packages { - development = ["go@1.21.6", "gotools@0.16.1", "delve@1.22.0", "go-task@~3.37.2", "golangci-lint@~1.59.0"] + development = ["go@1.21.6", "gotools@0.16.1", "delve@1.22.0", "go-task@~3.37.2"] runtime = ["cacert@3.95"] } diff --git a/bsf.lock b/bsf.lock index 1a957a51..197b6d78 100644 --- a/bsf.lock +++ b/bsf.lock @@ -5,13 +5,13 @@ "packages": [ { "package": { - "name": "go", + "name": "delve", "revision": "a731d0cb71c58f56895f71a5b02eda2962a46746", - "version": "1.21.6", - "description": "The Go Programming language", - "homepage": "https://go.dev/", + "version": "1.22.0", + "description": "debugger for the Go programming language", + "homepage": "https://github.com/go-delve/delve", "free": true, - "spdx_id": "BSD-3-Clause", + "spdx_id": "MIT", "epoch_seconds": 1705066566, "platforms": [ "x86_64-darwin", @@ -43,89 +43,6 @@ }, "runtime": false }, - { - "package": { - "name": "gotools", - "revision": "ac5c1886fd9fe49748d7ab80accc4c847481df14", - "version": "0.16.1", - "description": "Additional tools for Go development", - "homepage": "https://go.googlesource.com/tools", - "free": true, - "spdx_id": "BSD-3-Clause", - "epoch_seconds": 1699289668, - "platforms": [ - "x86_64-darwin", - "i686-darwin", - "aarch64-darwin", - "armv7a-darwin", - "aarch64-linux", - "armv5tel-linux", - "armv6l-linux", - "armv7a-linux", - "armv7l-linux", - "i686-linux", - "loongarch64-linux", - "m68k-linux", - "microblaze-linux", - "microblazeel-linux", - "mips-linux", - "mips64-linux", - "mips64el-linux", - "mipsel-linux", - "powerpc64-linux", - "powerpc64le-linux", - "riscv32-linux", - "riscv64-linux", - "s390-linux", - "s390x-linux", - "x86_64-linux" - ] - }, - "runtime": false - }, - { - "package": { - "name": "golangci-lint", - "revision": "7445ccd775d8b892fc56448d17345443a05f7fb4", - "version": "1.59.0", - "description": "Fast linters Runner for Go", - "homepage": "https://golangci-lint.run/", - "free": true, - "spdx_id": "GPL-3.0-or-later", - "epoch_seconds": 1716993062, - "platforms": [ - "x86_64-darwin", - "i686-darwin", - "aarch64-darwin", - "armv7a-darwin", - "aarch64-linux", - "armv5tel-linux", - "armv6l-linux", - "armv7a-linux", - "armv7l-linux", - "i686-linux", - "loongarch64-linux", - "m68k-linux", - "microblaze-linux", - "microblazeel-linux", - "mips-linux", - "mips64-linux", - "mips64el-linux", - "mipsel-linux", - "powerpc64-linux", - "powerpc64le-linux", - "riscv32-linux", - "riscv64-linux", - "s390-linux", - "s390x-linux", - "x86_64-linux", - "wasm64-wasi", - "wasm32-wasi" - ], - "attr_name": "golangci-lint" - }, - "runtime": false - }, { "package": { "name": "go-task", @@ -171,14 +88,14 @@ }, { "package": { - "name": "delve", - "revision": "a731d0cb71c58f56895f71a5b02eda2962a46746", - "version": "1.22.0", - "description": "debugger for the Go programming language", - "homepage": "https://github.com/go-delve/delve", + "name": "gotools", + "revision": "ac5c1886fd9fe49748d7ab80accc4c847481df14", + "version": "0.16.1", + "description": "Additional tools for Go development", + "homepage": "https://go.googlesource.com/tools", "free": true, - "spdx_id": "MIT", - "epoch_seconds": 1705066566, + "spdx_id": "BSD-3-Clause", + "epoch_seconds": 1699289668, "platforms": [ "x86_64-darwin", "i686-darwin", @@ -298,6 +215,46 @@ ] }, "runtime": true + }, + { + "package": { + "name": "go", + "revision": "a731d0cb71c58f56895f71a5b02eda2962a46746", + "version": "1.21.6", + "description": "The Go Programming language", + "homepage": "https://go.dev/", + "free": true, + "spdx_id": "BSD-3-Clause", + "epoch_seconds": 1705066566, + "platforms": [ + "x86_64-darwin", + "i686-darwin", + "aarch64-darwin", + "armv7a-darwin", + "aarch64-linux", + "armv5tel-linux", + "armv6l-linux", + "armv7a-linux", + "armv7l-linux", + "i686-linux", + "loongarch64-linux", + "m68k-linux", + "microblaze-linux", + "microblazeel-linux", + "mips-linux", + "mips64-linux", + "mips64el-linux", + "mipsel-linux", + "powerpc64-linux", + "powerpc64le-linux", + "riscv32-linux", + "riscv64-linux", + "s390-linux", + "s390x-linux", + "x86_64-linux" + ] + }, + "runtime": false } ] } \ No newline at end of file diff --git a/bsf/flake.nix b/bsf/flake.nix index f4d1270f..a38079d9 100644 --- a/bsf/flake.nix +++ b/bsf/flake.nix @@ -3,8 +3,8 @@ description = ""; inputs = { - nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746.url = "github:nixos/nixpkgs/a731d0cb71c58f56895f71a5b02eda2962a46746"; nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14.url = "github:nixos/nixpkgs/ac5c1886fd9fe49748d7ab80accc4c847481df14"; + nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746.url = "github:nixos/nixpkgs/a731d0cb71c58f56895f71a5b02eda2962a46746"; nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4.url = "github:nixos/nixpkgs/7445ccd775d8b892fc56448d17345443a05f7fb4"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; @@ -26,8 +26,8 @@ - nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14, + nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4, }: let supportedSystems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" "aarch64-linux" ]; @@ -36,8 +36,8 @@ forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { inherit system; - nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs = import nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746 { inherit system; }; nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs = import nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14 { inherit system; }; + nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs = import nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746 { inherit system; }; nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs = import nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4 { inherit system; }; buildGoApplication = gomod2nix.legacyPackages.${system}.buildGoApplication; @@ -50,8 +50,8 @@ buildGoApplication, - nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, + nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { default = pkgs.callPackage ./default.nix { @@ -68,8 +68,8 @@ - nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, + nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { devShell = pkgs.mkShell { @@ -78,7 +78,6 @@ nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs.delve nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs.go nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.go-task - nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.golangci-lint nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs.gotools ]; @@ -90,7 +89,7 @@ - nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { + nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { runtime = pkgs.buildEnv { name = "runtimeenv"; paths = [ @@ -105,14 +104,13 @@ - nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { + nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: { development = pkgs.buildEnv { name = "devenv"; paths = [ nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs.delve nixpkgs-a731d0cb71c58f56895f71a5b02eda2962a46746-pkgs.go nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.go-task - nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.golangci-lint nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs.gotools ]; From 1ebad04b977573246edd3bfcf8cbd9d7879d7ac7 Mon Sep 17 00:00:00 2001 From: House Date: Sun, 2 Jun 2024 14:22:44 +0530 Subject: [PATCH 4/5] fix updateVersion test cases Signed-off-by: House --- pkg/update/update_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/update/update_test.go b/pkg/update/update_test.go index 84f5099d..ea610c09 100644 --- a/pkg/update/update_test.go +++ b/pkg/update/update_test.go @@ -23,7 +23,7 @@ func TestGetLatestPatchVersion(t *testing.T) { }, }, version: "1.2.0", - want: "v1.2.3", + want: "1.2.3", }, { name: "Test Case 2", @@ -35,7 +35,7 @@ func TestGetLatestPatchVersion(t *testing.T) { }, }, version: "1.3.0", - want: "v1.3.3", + want: "1.3.3", }, { name: "Test Case 3", @@ -54,7 +54,7 @@ func TestGetLatestPatchVersion(t *testing.T) { }, }, version: "1.4.0", - want: "v1.4.0", + want: "1.4.0", }, { @@ -67,7 +67,7 @@ func TestGetLatestPatchVersion(t *testing.T) { }, }, version: "1.3.3", - want: "v1.3.3", + want: "1.3.3", }, } @@ -97,7 +97,7 @@ func TestGetLatestMinorVersion(t *testing.T) { }, }, version: "1.2.0", - want: "v1.4.3", + want: "1.4.3", }, { name: "Test Case 2", @@ -111,7 +111,7 @@ func TestGetLatestMinorVersion(t *testing.T) { }, }, version: "1.3.0", - want: "v1.4.1", + want: "1.4.1", }, } From dca5bf3f7c89aedd574c1367df0be3ed0fbe9a1b Mon Sep 17 00:00:00 2001 From: Praful Khanduri <99384392+Horiodino@users.noreply.github.com> Date: Sun, 2 Jun 2024 14:42:06 +0530 Subject: [PATCH 5/5] update test.yml --- .github/workflows/test.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9da3abf..a65d229f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,23 +1,27 @@ -name: Taskfile CI +name: Taskfile Ci on: push: branches: - main - task-ci + jobs: - build: + test_all: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + - name: git checkout + uses: actions/checkout@v3 - name: Install Nix - uses: cachix/install-nix-action@v17 - - - name: Install Task - uses: nicknovitski/nix-develop@v1 + uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Check Nixpkgs inputs + uses: DeterminateSystems/flake-checker-action@main with: - arguments: "bsf/.#devShell" - - - name: go test + fail-mode: true + flake-lock-path: ./bsf/flake.lock + - uses: nicknovitski/nix-develop@v1 + with: + arguments: bsf/.#devShell + - name: run tests run: task test