From df5de6adc34a154456e8e50b5f1c195947b3219a Mon Sep 17 00:00:00 2001 From: Jaro-c <75870284+Jaro-c@users.noreply.github.com> Date: Sat, 18 Jul 2026 16:29:52 -0500 Subject: [PATCH] ci: add workflow running vet, fmt check and tests on push/PR Closes #19, closes #20 --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9ad2424 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + pull_request: + branches: [master, develop] + push: + branches: [master, develop] + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + checks: + name: Checks (vet + test) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + + - name: Setup Go + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + with: + go-version: "1.24.5" + cache: true + + - name: Gofmt check + run: | + fmt_diff=$(gofmt -l .) + if [ -n "$fmt_diff" ]; then + echo "The following files are not gofmt'd:" + echo "$fmt_diff" + exit 1 + fi + + - name: Vet + run: go vet ./... + + - name: Test + run: go test ./...