diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..6753e98 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,31 @@ +name: Build + +on: + pull_request: + branches: + - main + - v* + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: true + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 + - name: Checkout code + uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: /home/runner/go/pkg/mod + key: go-mod + - name: Build and run tests + run: | + make test \ No newline at end of file diff --git a/.tool-versions b/.tool-versions index 1799f52..463dd77 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -golang 1.19 +golang 1.21 diff --git a/Makefile b/Makefile index 8a8e9ff..a34306f 100644 --- a/Makefile +++ b/Makefile @@ -5,19 +5,19 @@ default: build build: go build -v -test: +test: build go test -v ./... dockerbuild: - docker run --rm -it -v `pwd`:/workspace -w /workspace golang:1.17 go build -v + docker run --rm -it -v `pwd`:/workspace -w /workspace golang:1.21 go build -v dockertest: - docker run --rm -it -v `pwd`:/workspace -w /workspace golang:1.17 go test -v ./... + docker run --rm -it -v `pwd`:/workspace -w /workspace golang:1.21 go test -v ./... release: - docker run --rm -it -v `pwd`:/workspace -w /workspace -e GITHUB_TOKEN golang:1.17 /workspace/scripts/release.sh + docker run --rm -it -v `pwd`:/workspace -w /workspace -e GITHUB_TOKEN golang:1.21 /workspace/scripts/release.sh snapshot: - docker run --rm -it -v `pwd`:/workspace -w /workspace -e GITHUB_TOKEN golang:1.17 /workspace/scripts/release.sh --snapshot + docker run --rm -it -v `pwd`:/workspace -w /workspace -e GITHUB_TOKEN golang:1.21 /workspace/scripts/release.sh --snapshot .PHONY: build test changelog targets $(TARGETS) diff --git a/go.mod b/go.mod index 41fa730..c2c9da4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/sl1pm4t/k2tf -go 1.19 +go 1.21 require ( github.com/hashicorp/go-multierror v1.1.1