Skip to content

Merge pull request #42 from estesp/dependabot/go_modules/function/git… #76

Merge pull request #42 from estesp/dependabot/go_modules/function/git…

Merge pull request #42 from estesp/dependabot/go_modules/function/git… #76

Workflow file for this run

name: CI
on:
push:
branches:
- main
- 'release/**'
pull_request:
branches:
- main
- 'release/**'
jobs:
#
# golangci-lint
#
linters:
name: Linters
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
go-version: [1.20.x]
os: [ubuntu-22.04, macos-12, windows-2019]
steps:
- uses: actions/checkout@v3
with:
path: src/github.com/estesp/mquery
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: golangci/golangci-lint-action@v3
with:
version: v1.51.1
skip-cache: true
working-directory: src/github.com/estesp/mquery
args: --timeout=5m
#
# Project checks
#
project:
name: DCO/Vendor Checks
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
with:
path: src/github.com/estesp/mquery
fetch-depth: 100
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Install dependencies
env:
GO111MODULE: off
run: go get -u github.com/vbatts/git-validation
- name: DCO
env:
GITHUB_COMMIT_URL: ${{ github.event.pull_request.commits_url }}
DCO_VERBOSITY: "-q"
DCO_RANGE: ""
working-directory: src/github.com/estesp/mquery
run: |
if [ -z "${GITHUB_COMMIT_URL}" ]; then
DCO_RANGE=$(jq -r '.before +".."+ .after' ${GITHUB_EVENT_PATH})
else
DCO_RANGE=$(curl ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha +".."+ .[-1].sha')
fi
GIT_CHECK_EXCLUDE="./vendor:./function/vendor" git-validation -range "${DCO_RANGE}" -run DCO,short-subject,dangling-whitespace
- name: Vendor Checks
working-directory: src/github.com/estesp/mquery
run: |
./hack/vendor.sh
cd function && ../hack/vendor.sh
#
# Build binaries
#
binaries:
name: Build
runs-on: ${{ matrix.os }}
timeout-minutes: 10
needs: [project, linters]
strategy:
matrix:
os: [ubuntu-22.04, macos-12, windows-2019]
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
with:
path: src/github.com/estesp/mquery
- name: Make
run: make binary
working-directory: src/github.com/estesp/mquery
#
# Cross-built architectures
#
cross:
name: Cross-builds & Lambda function
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: [project, linters]
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
with:
path: src/github.com/estesp/mquery
- name: Make cross-built binaries
run: |
make cross
cd function && GOOS=linux go build -o function inspect.go
working-directory: src/github.com/estesp/mquery