diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 0000000..73da2ca --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,27 @@ +name: Build project and run tests +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] +jobs: + build: + strategy: + matrix: + go: [ 1.23.x, 1.24.x ] + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Set up Go 1.21.x + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + cache-dependency-path: ./go.sum + - name: Install dependencies + run: go get . + - name: Build + run: go build + - name: Test + run: go test . + diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..0f7e9e5 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,30 @@ +name: golangci-lint +on: + push: + branches: + - main + - master + pull_request: + +permissions: + contents: read + # Optional: allow read access to pull requests. Use with `only-new-issues` option. + # pull-requests: read + +jobs: + golangci: + strategy: + matrix: + go: [1.23.x, 1.24.x] + os: [ubuntu-latest] + name: lint + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + - name: golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: v2.1 \ No newline at end of file