109 lines
4.0 KiB
YAML
109 lines
4.0 KiB
YAML
name: Haskell CI (Stack)
|
|
|
|
on:
|
|
schedule:
|
|
# Run every weekday
|
|
- cron: '0 0 * * 1-5'
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
stack-build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
ghc: ['8.8']
|
|
cabal: ['3.2']
|
|
os: [ubuntu-latest, macOS-latest]
|
|
experimental: [false]
|
|
include:
|
|
# Appears to be buggy to build in windows with ghc 8.8
|
|
- 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 }}
|
|
enable-stack: true
|
|
|
|
- name: Cache
|
|
uses: actions/cache@v2
|
|
env:
|
|
cache-name: stack-cache-${{ matrix.ghc }}-${{ matrix.cabal }}
|
|
with:
|
|
path: |
|
|
~/.cabal
|
|
~/.stack
|
|
%appdata%\cabal
|
|
%LOCALAPPDATA%\Programs\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
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
run: |
|
|
/tmp/minio/minio server --quiet --certs-dir /tmp/minio-config/certs data1 data2 data3 data4 2>&1 > minio.log &
|
|
ghc --version
|
|
stack --version
|
|
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --flag minio-hs:examples
|
|
stack test --system-ghc --flag minio-hs:live-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
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
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
|
|
stack --version
|
|
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --flag minio-hs:examples
|
|
stack test --system-ghc --flag minio-hs:live-test
|