Merge pull request #23 from stackql/feature/override-response-type-co… #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
tags: | |
- build* | |
pull_request: | |
branches: | |
- main | |
- develop | |
env: | |
GOGETCMD: "go get -v -t -d ./..." | |
GOTESTCMD: "go test -timeout 240s -v ./..." | |
GOPRIVATE: github.com/stackql/* | |
GH_ACCESS_TOKEN: ${{ secrets.ACTIONS_PRIVATE_PACKAGE_SECRET }} | |
PLANCACHEENABLED: "true" | |
jobs: | |
winbuild: | |
name: Windows Build | |
runs-on: windows-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.13 | |
id: go | |
- name: Get rid of dissruptive line endings before checkout | |
run: | | |
git config --global core.autocrlf false | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Get dependencies | |
run: | | |
go env -w GOPRIVATE="github.com/stackql/*" | |
git config --global url."https://$env:[email protected]/".insteadOf "https://github.com/" | |
git --no-pager config --list | |
go get -v -t -d ./... | |
env: | |
GOGETCMD: ${{env.GOGETCMD}} | |
CGO_ENABLED: 1 | |
GHACCESSTOKEN: ${{env.GH_ACCESS_TOKEN}} | |
GOPRIVATE: ${{env.GOPRIVATE}} | |
- name: Generate Build Flags and Build | |
env: | |
BUILDCOMMITSHA: ${{github.sha}} | |
BUILDBRANCH: ${{github.ref}} | |
BUILDPLATFORM: ${{runner.os}} | |
BUILDPATCHVERSION: ${{github.run_number}} | |
CGO_ENABLED: 1 | |
GH_ACCESS_TOKEN: ${{env.GH_ACCESS_TOKEN}} | |
GOPRIVATE: ${{env.GOPRIVATE}} | |
run: | | |
git config --global url.https://$env:[email protected]/.insteadOf https://github.com/ | |
$BuildCommitSHA = $env:BUILDCOMMITSHA | |
$BuildShortCommitSHA = "$BuildCommitSHA".Substring(0,6) | |
$BuildDate = (Get-Date -UFormat "%a %b %e %H:%M:%S UTC %Y").ToString() | |
$BuildPlatform = $env:BUILDPLATFORM | |
$PlanCacheEnabled = $env:PLANCACHEENABLED | |
Write-Output $BuildCommitSHA | |
Write-Output $BuildShortCommitSHA | |
Write-Output $BuildDate | |
Write-Output $BuildPlatform | |
go build -x -v ` | |
-o ostackqtool ./cmd/interrogate | |
- name: Test | |
if: success() | |
run: go test -timeout 240s -v ./... | |
linuxbuild: | |
name: Linux Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.13 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Get dependencies | |
run: | | |
git config --global url.https://[email protected]/.insteadOf https://github.com/ | |
$GOGETCMD | |
env: | |
GOGETCMD: ${{env.GOGETCMD}} | |
GH_ACCESS_TOKEN: ${{env.GH_ACCESS_TOKEN}} | |
GOPRIVATE: ${{env.GOPRIVATE}} | |
- name: Generate Build Flags and Build | |
env: | |
BUILDCOMMITSHA: ${{github.sha}} | |
BUILDBRANCH: ${{github.ref}} | |
BUILDPLATFORM: ${{runner.os}} | |
BUILDPATCHVERSION: ${{github.run_number}} | |
run: | | |
BUILDSHORTCOMMITSHA=$(echo $BUILDCOMMITSHA | cut -c 1-7) | |
BUILDDATE=$(date) | |
echo "BUILDBRANCH: ${BUILDBRANCH}" | |
echo "BUILDCOMMITSHA: ${BUILDCOMMITSHA}" | |
echo "BUILDSHORTCOMMITSHA: ${BUILDSHORTCOMMITSHA}" | |
echo "BUILDDATE: ${BUILDDATE}" | |
echo "BUILDPLATFORM: ${BUILDPLATFORM}" | |
go build -x -v \ | |
-o ostackqtool ./cmd/interrogate | |
- name: Test | |
if: success() | |
run: go test -timeout 240s -v ./... | |
macosbuild: | |
name: MacOS Build | |
runs-on: macos-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.13 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Get dependencies | |
run: | | |
git config --global url.https://[email protected]/.insteadOf https://github.com/ | |
$GOGETCMD | |
env: | |
GOGETCMD: ${{env.GOGETCMD}} | |
CGO_ENABLED: 1 | |
GH_ACCESS_TOKEN: ${{env.GH_ACCESS_TOKEN}} | |
GOPRIVATE: ${{env.GOPRIVATE}} | |
- name: Generate Build Flags and Build | |
env: | |
BUILDCOMMITSHA: ${{github.sha}} | |
BUILDBRANCH: ${{github.ref}} | |
BUILDPLATFORM: ${{runner.os}} | |
BUILDPATCHVERSION: ${{github.run_number}} | |
CGO_ENABLED: 1 | |
run: | | |
BUILDSHORTCOMMITSHA=$(echo $BUILDCOMMITSHA | cut -c 1-7) | |
BUILDDATE=$(date) | |
echo "BUILDBRANCH: ${BUILDBRANCH}" | |
echo "BUILDCOMMITSHA: ${BUILDCOMMITSHA}" | |
echo "BUILDSHORTCOMMITSHA: ${BUILDSHORTCOMMITSHA}" | |
echo "BUILDDATE: ${BUILDDATE}" | |
echo "BUILDPLATFORM: ${BUILDPLATFORM}" | |
go build -x -v \ | |
-o ostackqtool ./cmd/interrogate | |
- name: Test | |
if: success() | |
run: go test -timeout 240s -v ./... | |
macosarmbuild: | |
name: MacOS ARM Build | |
runs-on: macos-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.16 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Get dependencies | |
run: | | |
git config --global url.https://[email protected]/.insteadOf https://github.com/ | |
$GOGETCMD | |
env: | |
GOGETCMD: ${{env.GOGETCMD}} | |
CGO_ENABLED: 1 | |
GH_ACCESS_TOKEN: ${{env.GH_ACCESS_TOKEN}} | |
GOPRIVATE: ${{env.GOPRIVATE}} | |
- name: Generate Build Flags and Build | |
env: | |
BUILDCOMMITSHA: ${{github.sha}} | |
BUILDBRANCH: ${{github.ref}} | |
BUILDPLATFORM: "darwin_arm64" | |
BUILDPATCHVERSION: ${{github.run_number}} | |
CGO_ENABLED: 1 | |
run: | | |
BUILDSHORTCOMMITSHA=$(echo $BUILDCOMMITSHA | cut -c 1-7) | |
BUILDDATE=$(date) | |
echo "BUILDBRANCH: ${BUILDBRANCH}" | |
echo "BUILDCOMMITSHA: ${BUILDCOMMITSHA}" | |
echo "BUILDSHORTCOMMITSHA: ${BUILDSHORTCOMMITSHA}" | |
echo "BUILDDATE: ${BUILDDATE}" | |
echo "BUILDPLATFORM: ${BUILDPLATFORM}" | |
GOOS=darwin GOARCH=arm64 \ | |
go build -x -v \ | |
-o ostackqtool ./cmd/interrogate |