Skip to content

Dev

Dev #92

Workflow file for this run

name: test
on: pull_request
jobs:
tag:
name: Calculate next version tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Calculate tag
uses: mathieudutour/github-tag-action@v6.1
id: tag
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: WillAbides/setup-go-faster@v1.8.0
with:
go-version: '1.19'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
analyze:
name: Analyze code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
containers:
name: Create containers
runs-on: ubuntu-latest
needs:
- lint
- analyze
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: WillAbides/setup-go-faster@v1.8.0
with:
go-version: '1.19'
- name: Setup Ko
uses: imjasonh/setup-ko@v0.6
with:
version: v0.11.2
- name: Build containers
run: |
ko build \
--base-import-paths \
--platform=linux/amd64,linux/arm/v7,linux/arm64 \
--push=false \
--image-label="org.opencontainers.image.title=${{ github.event.repository.name }}" \
--image-label="org.opencontainers.image.description=${{ github.event.repository.description }}" \
--image-label="org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--image-label="org.opencontainers.image.revision=${{ github.sha }}" \
./
binaries:
name: Create binaries
runs-on: ubuntu-latest
needs:
- lint
- analyze
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm, arm64]
exclude:
- goos: windows
goarch: "386"
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: WillAbides/setup-go-faster@v1.8.0
with:
go-version: '1.19'
- name: Build binaries
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
go build