Skip to content

OPCT-00: CI: add job cmd-report #409

OPCT-00: CI: add job cmd-report

OPCT-00: CI: add job cmd-report #409

Workflow file for this run

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
- 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-*
cmd-report:
name: "run-report"
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: opct-linux-amd64
path: /tmp/build/
- name: Running report
env:
RESULT_ARTIFACT_URL: "https://openshift-provider-certification.s3.us-west-2.amazonaws.com"
RESULT_ARTIFACT_VERSION: "v0.4.0/default/4.15.0-20240228-HighlyAvailable-vsphere-None.tar.gz"
run: |
echo "> Downloading sample artifact: ${BASELINE_ARTIFACT_URL}"
wget -O /tmp/result.tar.gz "${RESULT_ARTIFACT_URL}/${RESULT_ARTIFACT_VERSION}"
echo "> Extracting built artifact:"
ls -lR /tmp/build || true
cd /tmp && unzip /tmp/build/opct-linux-amd64 && chmod u+x /tmp/opct-linux-amd64
echo "> Running OPCT report:"
/tmp/opct-linux-amd64 report /tmp/result.tar.gz