feat(ci): Adds some CI
This commit is contained in:
parent
86df61986e
commit
dbe6120da6
5 changed files with 149 additions and 0 deletions
18
.gitea/workflows/on_pr.yml
Normal file
18
.gitea/workflows/on_pr.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
name: build
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22
|
||||
cache: true
|
||||
- run: go mod tidy
|
||||
- run: go test -v ./...
|
||||
- run: go build
|
28
.gitea/workflows/on_tag.yml
Normal file
28
.gitea/workflows/on_tag.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
name: Build and release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22
|
||||
cache: true
|
||||
- run: go mod tidy
|
||||
- run: go test -v ./...
|
||||
- run: git reset --hard
|
||||
- uses: goreleaser/goreleaser-action@v2
|
||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GORELEASER_FORCE_TOKEN: gitea
|
||||
GITEA_TOKEN: ${{ secrets.TOKEN }}
|
20
.gitea/workflows/push_master.yml
Normal file
20
.gitea/workflows/push_master.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
name: build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22
|
||||
cache: true
|
||||
- run: go mod tidy
|
||||
- run: go test -v ./...
|
||||
- run: go build
|
Loading…
Add table
Add a link
Reference in a new issue