2023-10-18 15:27:41 +03:00
|
|
|
name: Test
|
2023-08-26 23:01:45 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
jobs:
|
2023-10-18 15:27:41 +03:00
|
|
|
unit:
|
2023-08-26 23:01:45 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-10-18 15:27:41 +03:00
|
|
|
go: ['1.20','1.21']
|
2023-08-26 23:01:45 +03:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
fail-fast: true
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup Go ${{ matrix.go }}
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go }}
|
|
|
|
cache: false
|
|
|
|
|
|
|
|
- name: Run Tests
|
|
|
|
run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./...
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
with:
|
|
|
|
files: ./coverage
|