Skip to content

ci: bump the github-actions group across 1 directory with 2 updates #1622

ci: bump the github-actions group across 1 directory with 2 updates

ci: bump the github-actions group across 1 directory with 2 updates #1622

Workflow file for this run

name: pr-validation
on:
pull_request:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
check-latest: true
- name: Run tests against Linux SQL
run: |
go version
cd cmd/sqlcmd
go get -d
go build .
export SQLCMDPASSWORD=$(date +%s|sha256sum|base64|head -c 32)
export SQLCMDUSER=sa
docker run -m 2GB -e ACCEPT_EULA=1 -d --name sql2022 -p:1433:1433 -e SA_PASSWORD=$SQLCMDPASSWORD mcr.microsoft.com/mssql/server:2022-latest
echo "Waiting for SQL Server to be ready..."
READY=0
for i in {1..60}; do
if docker exec sql2022 /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$SQLCMDPASSWORD" -C -Q "SELECT 1" &>/dev/null; then
echo "SQL Server is ready!"
READY=1
break
fi
echo "Attempt $i: SQL Server not ready yet, waiting..."
sleep 2
done
if [ $READY -eq 0 ]; then
echo "ERROR: SQL Server failed to become ready within 2 minutes"
exit 1
fi
cd ../..
go test -v ./...