Skip to content

Merge pull request #65 from eddbbt/validation_error_handling #214

Merge pull request #65 from eddbbt/validation_error_handling

Merge pull request #65 from eddbbt/validation_error_handling #214

Workflow file for this run

#
# Copyright 2023 Ispirata Srl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Build and Test
on:
# Run when pushing to stable branches
push:
branches:
- 'master'
- 'release-*'
# Run on branch/tag creation
create:
# Run on pull requests
pull_request:
jobs:
test:
strategy:
matrix:
go:
- 1.19.x
- 1.20.x
- 1.21.x
os:
- ubuntu-22.04
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Build
run: go build -v ./...
- name: Test (with coverprofile)
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
if: matrix.os == 'ubuntu-22.04' && matrix.go == '1.21.x'
- name: Test (no coverprofile)
run: go test -v -race ./...
if: matrix.os != 'ubuntu-22.04' || matrix.go != '1.21.x'
# Upload coverage report only in one case of the matrix
- name: Upload coverage report
uses: codecov/codecov-action@v3
if: matrix.os == 'ubuntu-22.04' && matrix.go == '1.21.x'