* CI: Add support for GHC 8.10, stack and live-server testing * Fix live-server tests for all platforms * Fix windows tests * Fix resourcet cleanup exceptions * Mark minio-hs builds GHC 8.4, 8.8 on windows experimental * Use minio with erasure code backend for tests * Fix matrix combinations for cabal and stack Co-authored-by: Krishnan Parthasarathi <kp@minio.io>
120 lines
4.2 KiB
YAML
120 lines
4.2 KiB
YAML
name: Haskell CI (Cabal)
|
|
|
|
on:
|
|
schedule:
|
|
# Run every weekday
|
|
- cron: '0 0 * * 1-5'
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
cabal-build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
ghc: ['8.4', '8.6', '8.8', '8.10']
|
|
cabal: ['3.2']
|
|
os: [ubuntu-latest, macOS-latest]
|
|
experimental: [false]
|
|
include:
|
|
- ghc: '8.6'
|
|
cabal: '3.2'
|
|
os: windows-latest
|
|
experimental: false
|
|
- ghc: '8.10'
|
|
cabal: '3.2'
|
|
os: windows-latest
|
|
experimental: false
|
|
|
|
# Appears to be buggy to build in windows with ghc 8.4 and 8.8
|
|
- ghc: '8.4'
|
|
cabal: '3.2'
|
|
os: windows-latest
|
|
experimental: true
|
|
- ghc: '8.8'
|
|
cabal: '3.2'
|
|
os: windows-latest
|
|
experimental: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-haskell@v1.1
|
|
with:
|
|
ghc-version: ${{ matrix.ghc }}
|
|
cabal-version: ${{ matrix.cabal }}
|
|
|
|
- name: Cache
|
|
uses: actions/cache@v2
|
|
env:
|
|
cache-name: cabal-cache-${{ matrix.ghc }}-${{ matrix.cabal }}
|
|
with:
|
|
path: |
|
|
~/.cabal
|
|
~/.stack
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }}
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
${{ runner.os }}-build-
|
|
${{ runner.os }}-
|
|
|
|
- name: Before install (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
mkdir -p /tmp/minio /tmp/minio-config/certs
|
|
cp test/cert/* /tmp/minio-config/certs/
|
|
(cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/linux-amd64/minio; chmod +x ./minio)
|
|
sudo cp /tmp/minio-config/certs/public.crt /usr/local/share/ca-certificates/
|
|
sudo update-ca-certificates
|
|
|
|
- name: Before install (MacOS)
|
|
if: matrix.os == 'macos-latest'
|
|
run: |
|
|
mkdir -p /tmp/minio /tmp/minio-config/certs
|
|
cp test/cert/* /tmp/minio-config/certs/
|
|
(cd /tmp/minio; wget -q https://dl.min.io/server/minio/release/darwin-amd64/minio; chmod +x ./minio)
|
|
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/minio-config/certs/public.crt
|
|
|
|
- name: Before install (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
run: |
|
|
New-Item -ItemType Directory -Path "$env:temp/minio-config/certs/"
|
|
Copy-Item -Path test\cert\* -Destination "$env:temp/minio-config/certs/"
|
|
Invoke-WebRequest -Uri https://dl.minio.io/server/minio/release/windows-amd64/minio.exe -OutFile $HOME/minio.exe
|
|
Import-Certificate -FilePath "$env:temp/minio-config/certs/public.crt" -CertStoreLocation Cert:\LocalMachine\Root
|
|
|
|
- name: Install dependencies, build and test (Non-Windows)
|
|
if: matrix.os != 'windows-latest'
|
|
env:
|
|
MINIO_ACCESS_KEY: minio
|
|
MINIO_SECRET_KEY: minio123
|
|
MINIO_LOCAL: 1
|
|
MINIO_SECURE: 1
|
|
run: |
|
|
/tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
|
|
ghc --version
|
|
cabal --version
|
|
cabal new-update
|
|
cabal new-build --enable-tests --enable-benchmarks -fexamples
|
|
cabal new-test --enable-tests -flive-test
|
|
|
|
- name: Install dependencies, build and test (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
env:
|
|
MINIO_ACCESS_KEY: minio
|
|
MINIO_SECRET_KEY: minio123
|
|
MINIO_LOCAL: 1
|
|
MINIO_SECURE: 1
|
|
run: |
|
|
Start-Process -NoNewWindow -FilePath "$HOME/minio.exe" -ArgumentList "--certs-dir", "$env:temp/minio-config/certs", "server", "$env:temp/data1", "$env:temp/data2", "$env:temp/data3", "$env:temp/data4"
|
|
ghc --version
|
|
cabal --version
|
|
cabal new-update
|
|
cabal new-build --enable-tests --enable-benchmarks -fexamples
|
|
cabal new-test --enable-tests -flive-test
|