Skip to content

Commit

Permalink
.woodpecker: enable Codeberg CI (Woodpecker)
Browse files Browse the repository at this point in the history
Also update file headers to make the default header match tool work.

Signed-off-by: Sam Whited <[email protected]>
  • Loading branch information
SamWhited committed Jul 12, 2022
1 parent 96598e7 commit 17af19b
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 94 deletions.
35 changes: 0 additions & 35 deletions .builds/ci.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .builds/dco.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .builds/sync.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .woodpecker/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
pipeline:
dco:
image: alpine
commands:
- apk add git
- git version
- git fetch --no-tags origin +refs/heads/main
- |
set -e
function on_err {
[ $? -eq 0 ] && exit
cat <<EOF
Failed to sign the Developer Certificate of Origin (DCO)!
Please read the file "DCO" and then, if you agree, sign each of your commits
using:
git commit -s
Or quickly sign the previous commit with:
git commit --amend -s --no-edit
EOF
exit 1
}
trap on_err EXIT
# Check that all commits that aren't in main are signed off by the same
# committer (taken from the HEAD commit).
[[ ! "$(git log --pretty="%an <%ae>%n%(trailers:key=Signed-off-by,valueonly,separator=)" origin/main.. | uniq -u)" ]]
19 changes: 19 additions & 0 deletions .woodpecker/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pipeline:
info: &info
image: golang:${GO_VERSION}-alpine
environment:
CGO_ENABLED: "0"
commands:
- go version
- go env
test:
<< : *info
commands: go test -v -cover ./...

matrix:
GO_VERSION:
- 1.18
- 1.17

depends_on:
- dco
37 changes: 37 additions & 0 deletions .woodpecker/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
pipeline:
info: &info
image: golang:alpine
environment:
CGO_ENABLED: "0"
commands:
- go version
- go env
lint:
<< : *info
commands:
- go install honnef.co/go/tools/cmd/staticcheck@latest
- go install github.com/securego/gosec/v2/cmd/gosec@latest
- go install mellium.im/checkmd@latest
- go install git.sr.ht/~samwhited/checkdoc@latest
- export PATH=$(go env GOPATH)/bin:$PATH
- go vet ./...
- gofmt -s -l . && [ -z "$(gofmt -s -l .)" ]
# See: https://staticcheck.io/docs/checks
- staticcheck -checks inherit,ST1000,ST1003,ST1016,ST1020,ST1021,ST1022,ST1023 ./...
- gosec ./...
- |
checkdoc -fileheader.pattern='-' ./... <<EOF
Copyright \d\d\d\d The Mellium Contributors\.
Use of this source code is governed by the BSD 2-clause
license that can be found in the LICENSE file\.
EOF
- checkmd .
validate:
<< : *info
commands:
- apk add git
- go mod tidy
- git diff --exit-code -- go.mod go.sum

depends_on:
- dco
12 changes: 6 additions & 6 deletions cmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.

// Package cli can be used to create modern command line interfaces.
//
Expand All @@ -10,7 +10,7 @@
// For instance, if recreating the "git" command it might have a subcommand
// called "commit" and each could have their own flags:
//
// git -config mygit.config commit -interactive
// git -config mygit.config commit -interactive
//
// See the examples for more info.
package cli // import "mellium.im/cli"
Expand Down Expand Up @@ -82,7 +82,7 @@ func (c *Command) Help() {
// Name returns the first word of c.Usage which will be the name of the command.
// For example with a usage line of:
//
// commit [options]
// commit [options]
//
// Name returns "commit".
func (c *Command) Name() string {
Expand All @@ -96,9 +96,9 @@ func (c *Command) Name() string {
// ShortDesc returns the first line of c.Description.
// For example, given the description:
//
// Stores the current contents of the index.
// Stores the current contents of the index.
//
// The content to be added can be specified in several ways: …
// The content to be added can be specified in several ways: …
//
// ShortDesc returns "Stores the current contents of the index."
func (c *Command) ShortDesc() string {
Expand Down
4 changes: 2 additions & 2 deletions cmd_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.

package cli_test

Expand Down
4 changes: 2 additions & 2 deletions example_article_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.

package cli_test

Expand Down
4 changes: 2 additions & 2 deletions example_help_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.

package cli_test

Expand Down
4 changes: 2 additions & 2 deletions example_subcommands_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.

package cli_test

Expand Down
4 changes: 2 additions & 2 deletions example_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.

package cli_test

Expand Down
6 changes: 3 additions & 3 deletions help.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.

package cli

Expand All @@ -14,7 +14,7 @@ import (
//
// For example, in a program called "git" running:
//
// git help commit
// git help commit
//
// would print information about the "commit" subcommand.
func Help(cs *Command) *Command {
Expand Down

0 comments on commit 17af19b

Please sign in to comment.