Skip to content

Commit eccda8d

Browse files
committed
Port penrun to go
1 parent 3d1195f commit eccda8d

24 files changed

+792
-904
lines changed

.github/dependabot.yml

+5
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ updates:
88
directory: "/"
99
schedule:
1010
interval: "monthly"
11+
12+
- package-ecosystem: "gomod"
13+
directory: "/"
14+
schedule:
15+
interval: "monthly"

.github/workflows/tests.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@ permissions: {}
1010
jobs:
1111
tests:
1212
runs-on: ubuntu-latest
13-
container: debian:stable
13+
container: debian:bookworm
1414

1515
steps:
1616
- uses: actions/checkout@v3
17-
- name: install bats
17+
- name: install tools
1818
run: |
19-
apt-get update && apt-get install -y bats jq zstd git util-linux make
19+
echo "deb http://deb.debian.org/debian bookworm-backports main" > /etc/apt/sources.list.d/backports.list
20+
apt-get update
21+
apt-get install -y bats jq zstd git util-linux make
22+
apt-get install -y -t bookworm-backports golang-go
23+
go env -w GOTOOLCHAIN=go1.21.5+auto
24+
- name: build
25+
run: |
26+
make penrun
2027
- name: run bats
2128
run: |
22-
make test
29+
make test

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-FileCopyrightText: Stefan Tatschner
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
/penrun
6+
/penrun-artifacts

Dockerfile

-6
This file was deleted.

LICENSES/Apache-2.0.txt

-73
This file was deleted.

LICENSES/MIT.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) <year> <copyright holders>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

5+
GO ?= go
6+
7+
.PHONY: penrun
8+
penrun:
9+
$(GO) build $(GOFLAGS) -o $@ .
10+
511
.PHONY: lint
612
lint:
7-
find . \( -iname "penrun" -or -iname "*.sh" -or -iname "*.bats" \) | xargs shellcheck
8-
find . \( -iname "penrun" -or -iname "*.sh" -or -iname "*.bats" \) | xargs shfmt -d
13+
find . \( -iname "*.sh" -or -iname "*.bats" \) | xargs shellcheck
14+
find . \( -iname "*.sh" -or -iname "*.bats" \) | xargs shfmt -d
915

1016
.PHONY: fmt
1117
fmt:
12-
find . \( -iname "penrun" -or -iname "*.sh" -or -iname "*.bats" \) | xargs shfmt -w
18+
find . \( -iname "*.sh" -or -iname "*.bats" \) | xargs shfmt -w
1319

1420
.PHONY: test
1521
test:

config.sh

-52
This file was deleted.

flake.nix

+14-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,27 @@
1212
let pkgs = nixpkgs.legacyPackages.x86_64-linux;
1313
in {
1414
devShell.x86_64-linux = pkgs.mkShell {
15-
buildInputs = with pkgs; [
15+
buildInputs = with pkgs; [
16+
go
17+
gopls
1618
bats
19+
reuse
20+
shellcheck
21+
shfmt
1722
nodePackages_latest.bash-language-server
1823
];
1924
shellHook = ''
2025
LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [stdenv.cc.cc]}
2126
'';
2227
};
28+
packages.x86_64-linux.default =
29+
pkgs.buildGoModule {
30+
pname = "penrun";
31+
src = self;
32+
version = self.lastModifiedDate;
33+
buildInputs = [ pkgs.go ];
34+
vendorHash = "sha256-rUQ/iXG/lnvi01NXBOsu3CoG3YrYUFwPZDadTFThH3g=";
35+
};
2336
formatter.x86_64-linux = pkgs.nixpkgs-fmt;
2437
};
2538
}

go.mod

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// SPDX-FileCopyrightText: Stefan Tatschner
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
module github.com/rumpelsepp/penrun
6+
7+
go 1.21.5
8+
9+
require github.com/pelletier/go-toml/v2 v2.1.1
10+
11+
require (
12+
github.com/alecthomas/kong v0.8.1
13+
github.com/alecthomas/kong-toml v0.1.0
14+
github.com/klauspost/compress v1.17.4
15+
)
16+
17+
require github.com/pelletier/go-toml v1.9.5 // indirect

go.sum

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0=
2+
github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA=
3+
github.com/alecthomas/kong v0.8.1 h1:acZdn3m4lLRobeh3Zi2S2EpnXTd1mOL6U7xVml+vfkY=
4+
github.com/alecthomas/kong v0.8.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U=
5+
github.com/alecthomas/kong-toml v0.1.0 h1:jKrdGj/G0mkHGbOV5a+Cok3cTDZ+Qxa5CBq177gPKUA=
6+
github.com/alecthomas/kong-toml v0.1.0/go.mod h1:aDIxp+T6kJZY9zLThZX6qI9xxUlQgYlvqmw7PI//7/Y=
7+
github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE=
8+
github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
9+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
10+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
11+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
12+
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
13+
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
14+
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
15+
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
16+
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
17+
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
18+
github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI=
19+
github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
20+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
21+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
22+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
23+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
24+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
25+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
26+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
27+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
28+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
29+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
30+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
31+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
32+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

go.sum.license

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: Stefan Tatschner
2+
3+
SPDX-License-Identifier: CC0-1.0

0 commit comments

Comments
 (0)