Skip to content

Fix YDB invalid credentials tests (#213) #844

Fix YDB invalid credentials tests (#213)

Fix YDB invalid credentials tests (#213) #844

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
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.22.0', ]
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: |
go get ./...
- name: Run unit tests
run: |
go test -coverpkg=./... -coverprofile=coverage_unit_tests.out -covermode=atomic ./app/... ./common/... ./tests/utils/...
- name: Setup integration tests
uses: hoverkraft-tech/[email protected]
with:
compose-file: "tests/infra/datasource/docker-compose.yaml"
up-flags: "--build"
down-flags: "--volumes"
- name: Run integration tests
run: |
# cleanup some cache
go clean -cache
sudo rm -rf /usr/share/dotnet
docker logs runner-fq-connector-go-tests-ms_sql_server
go test -c -o fq-connector-go-tests -coverpkg=./... -covermode=atomic ./tests
./fq-connector-go-tests -projectPath=$(pwd) -test.coverprofile=coverage_integration_tests.out -test.failfast
- name: Union coverage
run: |
cat coverage_unit_tests.out > coverage.out
cat coverage_integration_tests.out | grep -v 'mode: atomic' >> coverage.out
go tool cover -func=coverage.out
rm coverage_unit_tests.out coverage_integration_tests.out
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4-beta
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
- name: Build
run: |
# FIXME: this script can't handle backticks in commit messages
# git fetch --prune --unshallow
# go run ./tools/version git
GOOS=linux go build -v -o fq-connector-go ./app