Skip to content

refactor: enhance validation for authenticating with console (#1235) #4177

refactor: enhance validation for authenticating with console (#1235)

refactor: enhance validation for authenticating with console (#1235) #4177

Workflow file for this run

#*********************************************************************
# Copyright (c) Intel Corporation 2021
# SPDX-License-Identifier: Apache-2.0
#*********************************************************************/
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [main, next, 2.x.x]
pull_request:
branches: [main, next, 2.x.x]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
permissions:
contents: read
jobs:
formatting:
name: runner / formatting
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Format
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
- name: Run go vet
run: go vet ./...
golangci-lint:
name: runner / golangci-lint
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: golangci-lint
uses: reviewdog/action-golangci-lint@c76cceaaab89abe74e649d2e34c6c9adc26662d2 # v2.10.0
with:
fail_level: error
golangci_lint_flags: "--config=./.golangci.yml ./..."
# This workflow contains a single job called "build"
build:
runs-on: ${{ matrix.os }}
permissions:
checks: write
pull-requests: write
strategy:
matrix:
go-version: [1.25]
os: [windows-2022, ubuntu-22.04, ubuntu-24.04]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417
with:
go-version: ${{ matrix.go-version }}
- name: Run unit tests (JUnit report + coverage)
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: |
export GOPATH="$HOME/go/"
export PATH=$PATH:$GOPATH/bin
go install gotest.tools/gotestsum@c4a0df2e75a225d979a444342dd3db752b53619f
gotestsum --junitfile rpc-go-unit.xml --format short-verbose -- -coverprofile=coverage.out -covermode=atomic ./...
- name: run the tests with coverage
if: ${{ matrix.os != 'ubuntu-24.04' }}
run: go test ./... -coverprofile=coverage.out -covermode=atomic
- name: Publish Unit Test Results
if: ${{ always() && matrix.os == 'ubuntu-24.04' }}
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0
with:
files: rpc-go-unit.xml
check_name: Unit tests (Go)
comment_mode: failures
report_individual_runs: true
- uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
if: ${{ matrix.os == 'ubuntu-24.04' }}
name: Upload Coverage Results
# Runs a single command using the runners shell
- name: build go
if: ${{ matrix.os == 'windows-2022' }}
run: go build -o rpc.exe ./cmd/rpc
# Runs a single command using the runners shell
- name: build go
if: ${{ matrix.os != 'windows-2022' }}
run: go build -o rpc ./cmd/rpc
# JUnit report is surfaced in PR Checks via the step above; artifact upload not needed.