diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 127fb0e..e3c0af2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,24 +1,35 @@ name: Build & Test on: - workflow_dispatch: + push: + branches: [main] pull_request: branches: [main] + workflow_dispatch: + +permissions: + contents: read jobs: build-and-test: runs-on: ubuntu-latest + defaults: + run: + working-directory: src steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - - uses: actions/setup-go@v5 + - name: Set up Go + uses: actions/setup-go@v7 with: - go-version-file: src/go.mod + go-version: "1.27.x" + cache-dependency-path: src/go.sum - name: Build - working-directory: src run: go build ./... - name: Test - working-directory: src - run: go test ./... + run: go test -race ./... + + - name: Vet + run: go vet ./... diff --git a/README.md b/README.md index 1e6d9c7..d08ff66 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Build & Test](https://github.com/markmnl/fmsgid/actions/workflows/go.yml/badge.svg)](https://github.com/markmnl/fmsgid/actions/workflows/go.yml) +[![Build & Test](https://github.com/markmnl/fmsgid/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/markmnl/fmsgid/actions/workflows/go.yml?query=branch%3Amain) +[![Go 1.27+](https://img.shields.io/badge/Go-1.27%2B-00ADD8?logo=go&logoColor=white)](https://go.dev/dl/) # fmsgid @@ -26,6 +27,8 @@ FMSGID_CSV_FILE=/path/to/addresses.csv ## Build +Requires Go 1.27 or newer. + From the `src` directory: ``` go build . diff --git a/src/go.mod b/src/go.mod index ececcc2..0015a84 100644 --- a/src/go.mod +++ b/src/go.mod @@ -1,6 +1,6 @@ module github.com/markmnl/fmsgid -go 1.25.0 +go 1.27.0 require ( github.com/fsnotify/fsnotify v1.9.0