diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..8a3c2ca --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,35 @@ +name: build and vet + +on: + pull_request: + branches_ignore: [] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + go: ['1.15', '1.16', '1.17', '1.18', '1.19', '1.20'] + + name: build and vet + steps: + + - uses: actions/checkout@v2 + with: + path: go/src/github.com/vbatts/tar-split + + - uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go }} + + - name: vet and build + env: + GOPATH: /home/runner/work/tar-split/tar-split/go + run: | + set -x + export PATH=$GOPATH/bin:$PATH + cd go/src/github.com/vbatts/tar-split + go test -v ./... + go vet -v ./... + go build -v ./... + #go run mage.go -v vet build test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..cf62b63 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,35 @@ +name: lint + +on: + pull_request: + branches_ignore: [] + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + go: ['1.20'] + + name: Linting + steps: + + - uses: actions/checkout@v2 + with: + path: go/src/github.com/vbatts/tar-split + + - uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go }} + + - name: lint + env: + GOPATH: /home/runner/work/tar-split/tar-split/go + run: | + set -x + #curl -sSL https://github.com/magefile/mage/releases/download/v1.14.0/mage_1.14.0_Linux-64bit.tar.gz | tar -xzv mage && mv mage $GOPATH/bin/ + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 + export PATH=$GOPATH/bin:$PATH + cd go/src/github.com/vbatts/tar-split + golangci-lint run + #go run mage.go -v lint