Start tmate session at beginning #224
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
# only one build per branch | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest] | |
ghc: ['9.10.1'] | |
cabal: ['3.10.3.0'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
# - name: Install MSYS for Windors | |
# if: runner.os == 'Windows' | |
# uses: msys2/setup-msys2@v2 | |
# - name: Setup - PostgreSQL | |
# id: postgres-setup | |
# uses: ikalnytskyi/action-setup-postgres@v7 | |
# with: | |
# postgres-version: "16" | |
# database: 'postgres' | |
# username: 'postgres' | |
# password: 'postgres' | |
- name: Setup - MySQL | |
id: mysql-setup | |
uses: shogo82148/actions-setup-mysql@v1 | |
with: | |
mysql-version: "9.0.1" | |
- name: Setup - GHC ${{ matrix.ghc }} | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
# Defaults, added for clarity: | |
cabal-version: ${{ matrix.cabal }} | |
cabal-update: true | |
# - name: Setup Haskell | |
# if: runner.os == 'Windows' | |
# run: | | |
# ghcup install ghc --set ${{ matrix.ghc }} | |
# ghcup install cabal --set ${{ matrix.cabal }} | |
# ghc --version | |
# cabal --version | |
# cabal update | |
- name: Install system dependencies - Windows | |
if: runner.os == 'Windows' | |
run: | | |
# ghcup should be installed on current GHA Windows runners. Let's use ghcup to run | |
# pacman, to install the necessary dependencies, ... | |
ghcup run --mingw-path -- pacman --noconfirm -S ` | |
mingw-w64-x86_64-pkg-config ` | |
mingw-w64-x86_64-pcre ` | |
mingw-w64-x86_64-libsodium ` | |
mingw-w64-x86_64-libmariadbclient ` | |
base-devel ` | |
autoconf-wrapper ` | |
autoconf ` | |
automake ` | |
libtool ` | |
make | |
$ghcMingwDir = Join-Path -Path $(ghc --print-libdir) ` | |
-ChildPath ../mingw/x86_64-*-mingw32/lib/ ` | |
-Resolve | |
cabal user-config -a "extra-prog-path: C:/msys64/mingw64/bin, C:/msys64/usr/bin" ` | |
-a "extra-include-dirs: C:/msys64/mingw64/include, /mingw64/include/mysql, \mingw64\include\mysql" ` | |
-a ("extra-lib-dirs: {0}, C:/msys64/mingw64/lib" -f $ghcMingwDir) ` | |
-f init | |
- name: Build - MySQL | |
run: cabal build mysql | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
- name: Build - All dependencies | |
run: cabal build all --only-dependencies | |
- name: Build | |
run: cabal build all --extra-include-dirs=/opt/homebrew/include | |
- name: Test | |
env: | |
PGSERVICE: ${{ steps.postgres-setup.outputs.service-name }} | |
MYSQL_STUFF: ${{ steps.mysql.outputs.base-dir }} | |
run: | | |
set -x | |
export MYSQL_UNIX_PORT=$(dirname $MYSQL_HOME)/tmp/mysql.sock | |
cabal run emulator-tests | |
# We run this only when a PR is merged so we can see how things are performing | |
# on the GH actions machines. | |
- name: Benchmark | |
if: github.ref == 'refs/heads/main' | |
run: cabal run emulator-tests | |