Skip to content

persistent-mysql: truncate foreign key constraint names to MySQL's 64 char limit #1556

persistent-mysql: truncate foreign key constraint names to MySQL's 64 char limit

persistent-mysql: truncate foreign key constraint names to MySQL's 64 char limit #1556

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
jobs:
build:
services:
postgres:
image: postgres:12-alpine
env:
POSTGRES_USER: perstest
POSTGRES_PASSWORD: perstest
POSTGRES_DB: persistent
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# mysql-service Label used to access the service container
mysql-service:
# Docker Hub image (also with version)
image: mysql:8.0
env:
## Accessing to Github secrets, where you can store your configuration
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: test
MYSQL_DATABASE: test
## map the "external" 33306 port with the "internal" 3306
ports:
- 33306:3306
# Set health checks to wait until mysql database has started (it takes some seconds to start)
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
runs-on: ubuntu-latest
strategy:
matrix:
cabal: ["3.12"]
ghc:
- "8.8"
- "8.10"
- "9.0"
- "9.2"
- "9.4"
- "9.6"
- "9.8"
- "9.10"
- "9.12"
env:
CONFIG: "--enable-tests --enable-benchmarks"
steps:
- uses: actions/checkout@v2
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Check MySQL connection
run: mysql -utest -ptest -h127.0.0.1 --port=33306 test -e "SELECT 1;"
- name: Start Redis
uses: shogo82148/actions-setup-redis@v1
- run: sudo apt-get update && sudo apt-get install -y libpcre3-dev
- run: cabal v2-update
- run: cabal v2-freeze $CONFIG
- run: cat cabal.project.freeze
- uses: actions/cache@v3
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
${{ runner.os }}-${{ matrix.ghc }}-
- run: cabal v2-build all --disable-optimization $CONFIG
# Start MongoDB *after* the heavy build, immediately before the tests that
# need it. Unlike postgres/mysql (declared as health-gated `services`),
# MongoDB is started by an action step with no readiness gate, and the
# test harness connects once with no retry. Starting it before the ~10m
# build left a long window where the container could be resource-starved
# and become unreachable, producing flaky "Connection refused" failures
# in the persistent-mongoDB suite.
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.12.0
with:
mongodb-version: '5.0'
- name: Wait for MongoDB to accept connections
run: |
for i in $(seq 1 30); do
if (exec 3<>/dev/tcp/127.0.0.1/27017) 2>/dev/null; then
exec 3>&- 3<&-
echo "MongoDB is accepting connections on 127.0.0.1:27017"
exit 0
fi
echo "Waiting for MongoDB... ($i/30)"
sleep 2
done
echo "MongoDB did not become reachable in time" >&2
exit 1
- run: cabal v2-test all --disable-optimization $CONFIG --test-options "--fail-on-focus"
- run: cabal v2-bench all --disable-optimization $CONFIG
- run: cabal v2-sdist all