diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml new file mode 100644 index 0000000..b891f07 --- /dev/null +++ b/.github/workflows/ci-build.yaml @@ -0,0 +1,40 @@ +name: CI Build + +on: + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.24.x' + cache: true + + - name: Download deps + run: go mod download + + - name: Test + run: go test ./... -v + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.24.x' + cache: true + + - name: golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: v2.1 diff --git a/README.md b/README.md index 2ff4182..430ab4b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # template-go + +[![CI Build](https://github.com/scadable/template-go/actions/workflows/ci-build.yaml/badge.svg)](https://github.com/scadable/template-go/actions/workflows/ci-build.yaml) + template used for go projects