Add Forgejo Actions workflow to build and test on push
Some checks are pending
Build and Test / build-and-test (push) Waiting to run
Some checks are pending
Build and Test / build-and-test (push) Waiting to run
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
42fd0a2af4
commit
15335a9f4c
1 changed files with 18 additions and 0 deletions
18
.forgejo/workflows/build.yml
Normal file
18
.forgejo/workflows/build.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
name: Build and Test
|
||||
on: [push]
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
|
||||
- name: Test
|
||||
run: docker run --rm -w /src -v $PWD:/src golang:1.26 go test ./...
|
||||
- name: Build
|
||||
run: docker run --rm -w /src -v $PWD:/src -e CGO_ENABLED=0 golang:1.26 go build -ldflags "-s -w" -o hsa ./cmd/hsa
|
||||
- name: Upload binary
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: hsa
|
||||
path: hsa
|
||||
Loading…
Reference in a new issue