OPCT-270: Added arm64 instructions and multi-arch builds #394
Workflow file for this run
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: "OPCT" | |
on: | |
pull_request: | |
branches: | |
- main | |
- release-* | |
push: | |
tags: | |
- '*' | |
jobs: | |
go-lint: | |
name: go-lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
cache: false | |
# https://github.com/golangci/golangci-lint-action | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.53 | |
args: --timeout=10m | |
go-static: | |
name: "go-staticcheck" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
- name: Run static code analysis | |
uses: dominikh/[email protected] | |
with: | |
version: "2022.1.3" | |
go-test: | |
name: go-test | |
runs-on: ubuntu-latest | |
needs: | |
- go-lint | |
- go-static | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
- name: Run unit tests | |
run: make test | |
go-vet: | |
name: "go-vet" | |
runs-on: ubuntu-latest | |
needs: | |
- go-lint | |
- go-static | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
- name: Run go vet | |
run: make vet | |
build: | |
name: "build-artifact" | |
runs-on: ubuntu-latest | |
needs: | |
- go-test | |
- go-vet | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.19 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y make git -y | |
# linux-amd64 and darwin-arm64 is built sepparately to | |
# be uploading individualy in Github CI build, preventing | |
# automatically packaging when upload the artifact. | |
- name: Build (OS=linux-amd64) | |
env: | |
OS_ARCH: linux-amd64 | |
run: | | |
make clean | |
make linux-amd64-container | |
make build-${OS_ARCH} | |
- name: Save artifacts (OS=linux-amd64) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: opct-linux-amd64 | |
path: | | |
build/opct-* | |
- name: Build (OS=darwin-arm64) | |
env: | |
OS_ARCH: darwin-arm64 | |
run: | | |
make clean | |
make build-${OS_ARCH} | |
- name: Save artifacts (OS=darwin-arm64) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: opct-darwin-arm64 | |
path: | | |
build/opct-* |