Skip to content

ILLDEV-464 Log duplicate check results #3070

ILLDEV-464 Log duplicate check results

ILLDEV-464 Log duplicate check results #3070

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: build-test
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- '**.go'
- '**.xsd'
- '**.html'
- '**.sql'
- '**.yaml'
- '**/Makefile'
- '**/Dockerfile' #run this workflow first to ensure tests are passing
- '**/chart/**' #trigger also when chart templates chnage to force republish
- '.github/**' #trigger when pipeline changes
- '**/go.mod' #trigger when dependencies change
- '**/ModuleDescriptor-template.json' #trigger when module descriptor changes
pull_request:
branches: [ "main" ]
paths:
- '**.go'
- '**.xsd'
- '**.html'
- '**.sql'
- '**.yaml'
- '**/Makefile'
- '**/Dockerfile' #run this workflow first to ensure tests are passing
- '**/chart/**' #trigger also when chart templates change to force republish
- '.github/**' #trigger when pipeline changes
- '**/go.mod' #trigger when dependencies change
- '**/ModuleDescriptor-template.json' #trigger when module descriptor changes
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
modules: [broker, illmock]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Load tool versions
run: cat .github/tool-versions.env >> "$GITHUB_ENV"
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: xsltproc libyaz-dev pkg-config
version: 1.0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
go.work.sum
${{ matrix.modules }}/go.sum
- name: Generate sources
run: make generate
- name: Lint module '${{ matrix.modules }}'
uses: golangci/golangci-lint-action@v9
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
working-directory: ${{ matrix.modules }}
- name: Build
run: make all
working-directory: ${{ matrix.modules }}
- name: Test
run: make check
working-directory: ${{ matrix.modules }}
- name: Check test coverage
uses: vladopajic/go-test-coverage@v2
continue-on-error: true
with:
config: ${{ matrix.modules }}/.testcoverage.yaml
profile: ${{ matrix.modules }}/coverage.out
- name: Check vulnerabilities in '${{ matrix.modules }}'
id: govulncheck
uses: golang/govulncheck-action@master
continue-on-error: true
with:
go-version-input: ${{ env.GO_VERSION }}
repo-checkout: false
go-package: ./...
output-format: text
work-dir: ${{ matrix.modules }}
#setup go already restores the cache
cache: false
- name: Report vulnerability findings in '${{ matrix.modules }}'
if: ${{ steps.govulncheck.outcome == 'failure' }}
run: echo "::error title=Govulncheck reported vulnerabilities in ${{ matrix.modules }}::Review the govulncheck step output before merging"
build-all:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Check all builds succeeded
needs: [build]
steps:
- run: |
result="${{ needs.build.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi