Skip to content

Commit

Permalink
Merge pull request #117 from sl1pm4t/gha
Browse files Browse the repository at this point in the history
Add GHA build workflow and update go version
  • Loading branch information
sl1pm4t authored May 18, 2024
2 parents 7e7b778 + 0140d01 commit c917e26
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 61 deletions.
54 changes: 0 additions & 54 deletions .drone.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
golang 1.19
golang 1.21
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/sl1pm4t/k2tf

go 1.19
go 1.21

require (
github.com/hashicorp/go-multierror v1.1.1
Expand Down

0 comments on commit c917e26

Please sign in to comment.