ci: add Forgejo Actions Workflow
This commit is contained in:
parent
d7c6a1a168
commit
59b7b0c794
3 changed files with 50 additions and 1 deletions
37
.forgejo/workflows/workflow.yaml
Normal file
37
.forgejo/workflows/workflow.yaml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
---
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- synchronize
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: docker
|
||||||
|
env:
|
||||||
|
GO_TEST_VERBOSE: "1"
|
||||||
|
GO_TEST_COVER: "1"
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
- name: Setup Go
|
||||||
|
uses: https://code.forgejo.org/actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.21'
|
||||||
|
- name: Test
|
||||||
|
run: go run magefiles/main.go -v test
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
- name: Setup Go
|
||||||
|
uses: https://code.forgejo.org/actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.21'
|
||||||
|
- name: Lint
|
||||||
|
uses: https://github.com/golangci/golangci-lint-action@v3
|
||||||
|
with:
|
||||||
|
version: v1.54
|
|
@ -1,5 +1,4 @@
|
||||||
//go:build mage
|
//go:build mage
|
||||||
// +build mage
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
13
magefiles/main.go
Normal file
13
magefiles/main.go
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
//go:build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/magefile/mage/mage"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
os.Exit(mage.Main())
|
||||||
|
}
|
Loading…
Reference in a new issue