Skip to content

Bump golang from 1.15.1 to 1.21.6 #66

Bump golang from 1.15.1 to 1.21.6

Bump golang from 1.15.1 to 1.21.6 #66

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, windows, darwin]
arch: [amd64]
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Verify go modules
run: go mod verify
- name: Check formatting
run: |
chmod +x $GITHUB_WORKSPACE/scripts/gofmtcheck.sh
$GITHUB_WORKSPACE/scripts/gofmtcheck.sh
- name: Linting
if: matrix.os == 'linux'
run: |
go get -u golang.org/x/lint/golint
golint .
- name: Get short commit hash and date
id: get_git_info
run: echo ::set-output name=HASH_DATE::$(git log -1 --pretty=format:"%h (%ci)" .)
- name: Build
run: |
mkdir -p dist/${GOOS}-${GOARCH}
go build -v -ldflags "-X \"main.buildVersion=${{ steps.get_git_info.outputs.HASH_DATE }}\"" -o dist/${GOOS}-${GOARCH}/ .
- name: Test
if: matrix.os == 'linux'
run: go test -v .
# - name: Build and Push if on master
# if: matrix.os == 'linux' && env.DOCKER_USERNAME != ''
# uses: docker/build-push-action@v1
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# repository: dbhi/prometheus-sql
# tag_with_sha: true
# tag_with_ref: true
# add_git_labels: true
# dockerfile: Dockerfile.github
# push: ${{ endsWith(github.ref, '/master') }}
# env:
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}