46 lines
960 B
YAML
46 lines
960 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Verify formatting
|
|
run: |
|
|
unformatted=$(gofmt -l .)
|
|
if [ -n "$unformatted" ]; then
|
|
echo "These files are not gofmt-formatted:"
|
|
echo "$unformatted"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Test
|
|
run: go test -v ./...
|
|
|
|
- name: Build
|
|
run: go build -o ./bin/triplex-example ./cmd/triplex-example
|
|
|
|
- name: Run example
|
|
run: |
|
|
if ./bin/triplex-example && ./bin/triplex-example --complete ABC-123-DE; then
|
|
echo "Example ran successfully"
|
|
else
|
|
echo "Example failed"
|
|
exit 1
|
|
fi
|