mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-14 10:09:09 -06:00
98 lines
2.5 KiB
YAML
98 lines
2.5 KiB
YAML
name: Test Go
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'go/**'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ci-go-tests-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
name: Go tests
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [macos-latest, ubuntu-22.04, windows-latest]
|
|
dolt_fmt: [ "__DOLT__", "__LD_1__" ]
|
|
include:
|
|
- os: "ubuntu-22.04"
|
|
dolt_fmt: "__DOLT_DEV__"
|
|
steps:
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ^1.19
|
|
id: go
|
|
- uses: actions/checkout@v2
|
|
- name: Test All
|
|
working-directory: ./go
|
|
run: |
|
|
files=$(go list ./...)
|
|
SAVEIFS=$IFS
|
|
IFS=$'\n'
|
|
file_arr=($files)
|
|
IFS=$SAVEIFS
|
|
|
|
for (( i=0; i<${#file_arr[@]}; i++ ))
|
|
do
|
|
echo "Testing Package: ${file_arr[$i]}"
|
|
if [ "$MATRIX_OS" == 'ubuntu-22.04' ]
|
|
then
|
|
if [[ "${file_arr[$i]}" != *enginetest* ]]; then
|
|
go test -timeout 45m -race "${file_arr[$i]}"
|
|
else
|
|
echo "skipping enginetests for -race"
|
|
fi
|
|
else
|
|
go test -timeout 45m "${file_arr[$i]}"
|
|
fi
|
|
succeeded=$(echo "$?")
|
|
if [ "$succeeded" -ne 0 ]; then
|
|
echo "Testing failed in package ${file_arr[$i]}"
|
|
exit 1;
|
|
fi
|
|
done
|
|
env:
|
|
MATRIX_OS: ${{ matrix.os }}
|
|
DOLT_DEFAULT_BIN_FORMAT: ${{ matrix.dolt_fmt }}
|
|
noracetest:
|
|
name: Go tests - no race
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [macos-latest, ubuntu-22.04, windows-latest]
|
|
dolt_fmt: [ "__DOLT__", "__LD_1__" ]
|
|
include:
|
|
- os: "ubuntu-22.04"
|
|
dolt_fmt: "__DOLT_DEV__"
|
|
steps:
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ^1.19
|
|
id: go
|
|
- uses: actions/checkout@v2
|
|
- name: Test All
|
|
working-directory: ./go
|
|
run: |
|
|
if [ -n "$DOLT_FMT" ]; then export DOLT_DEFAULT_BIN_FORMAT="$DOLT_FMT"; fi
|
|
go test -timeout 30m ./libraries/doltcore/sqle/altertests
|
|
go test -timeout 30m ./libraries/doltcore/sqle/integration_test
|
|
env:
|
|
DOLT_FMT: ${{ matrix.dolt_fmt }}
|
|
MATRIX_OS: ${{ matrix.os }}
|
|
DOLT_TEST_RUN_NON_RACE_TESTS: "true"
|