2024-07-12 00:37:10 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version-file: './go.mod'
|
|
|
|
- name: Install dependencies
|
|
|
|
run: go mod tidy
|
|
|
|
- name: Run tests
|
|
|
|
run: go test -v
|
|
|
|
sast:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version-file: './go.mod'
|
|
|
|
- name: Check formatting
|
|
|
|
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
|
2024-07-12 01:24:35 +00:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [sast, tests]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version-file: './go.mod'
|
|
|
|
- name: Build (Linux AMD64)
|
|
|
|
run: go build .
|
|
|
|
env:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: amd64
|
|
|
|
- name: Upload binary
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: cobble-linux-amd64
|
|
|
|
path: ./cobble
|