Merge pull request #374 from kquick/spellfix_kwq1 #1426
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: Haskell CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [self-hosted] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Install prereqs. | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y libgmp-dev zlib1g-dev | |
- name: Install GHC | |
uses: haskell/actions/setup@v1 | |
id: setup-haskell | |
with: | |
ghc-version: '9.4.5' | |
cabal-version: '3.8.1.0' | |
- name: Cache | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-cabal | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.cabal-store }} | |
dist-newstyle | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: | | |
cabal update | |
cabal build all --only-dependencies --enable-tests | |
# pretty much everything depends on this, so we build it here | |
- name: Build Daedalus | |
run: cabal build --enable-tests exe:daedalus | |
- name: Build Talos | |
run: cabal build --enable-tests exe:talos | |
- name: Build language server | |
run: cabal build daedalus-language-server | |
# Run the tests in matrix.components, in parallel. | |
tests: | |
name: Test ${{ matrix.component.name }} | |
runs-on: ${{ matrix.os }} | |
needs: [build] | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
component: [ { name: 'PDF DOM', verb: 'build', noun: 'exe:pdf-dom', flag: '' } | |
, { name: 'Talos', verb: 'test', noun: 'talos', flag: '' } | |
, { name: 'Daedalus', verb: 'test', noun: 'daedalus-tests', flag: '--test-show-details=streaming' } | |
, { name: 'Daedalus backends', verb: 'test', noun: 'daedalus-test-backends', flag: '--test-show-details=streaming' } | |
, { name: 'Daedalus using make', verb: 'test', noun: 'daedalus-test-makefile', flag: '--test-show-details=streaming' } | |
] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Install prereqs. | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y libgmp-dev zlib1g-dev | |
sudo apt-get install -y libboost-context-dev | |
- name: Install Z3 (Ubuntu) | |
if: matrix.component.noun == 'talos' && matrix.os == 'ubuntu-latest' | |
id: z3-install | |
# Download z3 and add bin to path | |
run: | | |
wget --quiet https://github.com/Z3Prover/z3/releases/download/z3-4.8.10/z3-4.8.10-x64-ubuntu-18.04.zip | |
unzip z3-4.8.10-x64-ubuntu-18.04.zip | |
echo "$PWD/z3-4.8.10-x64-ubuntu-18.04/bin" >> $GITHUB_PATH | |
# Copied from 'build' | |
- name: Install GHC | |
uses: haskell/actions/setup@v1 | |
id: setup-haskell | |
with: | |
ghc-version: '9.4.5' | |
cabal-version: '3.8.1.0' | |
- name: Cache | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-cabal | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.cabal-store }} | |
dist-newstyle | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: ${{ matrix.component.name }} (${{ matrix.component.verb }}) | |
run: cabal ${{ matrix.component.verb }} ${{ matrix.component.noun }} ${{ matrix.component.flag }} | |
pdf-driver: | |
runs-on: ${{ matrix.os }} | |
needs: [build] | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
# Copied from 'build' | |
- name: Install GHC | |
uses: haskell/actions/setup@v1 | |
id: setup-haskell | |
with: | |
ghc-version: '9.4.5' | |
cabal-version: '3.8.1.0' | |
- name: Cache | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-cabal | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.cabal-store }} | |
dist-newstyle | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Build COS | |
run: cabal build pdf-cos | |
- name: Build driver | |
run: cabal build pdf-driver | |
pdf-driver-cpp: | |
runs-on: ${{ matrix.os }} | |
needs: [build] | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
# Copied from 'build' | |
- name: Install GHC | |
uses: haskell/actions/setup@v1 | |
id: setup-haskell | |
with: | |
ghc-version: '9.4.5' | |
cabal-version: '3.8.1.0' | |
- name: Cache | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-cabal | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.cabal-store }} | |
dist-newstyle | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Build Daedalus | |
run: cabal build exe:daedalus | |
- name: Build C++ PDF driver | |
run: | | |
cmake -B build-pdf-c++ formats/pdf/new/c++/ | |
cmake --build build-pdf-c++ | |
http-test-suite: | |
runs-on: ${{ matrix.os }} | |
needs: [build] | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
# Copied from 'build' | |
- name: Install GHC | |
uses: haskell/actions/setup@v1 | |
id: setup-haskell | |
with: | |
ghc-version: '9.4.5' | |
cabal-version: '3.8.1.0' | |
- name: Cache | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-cabal | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.cabal-store }} | |
dist-newstyle | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Run HTTP parser test suite | |
run: | | |
cabal build exe:daedalus | |
formats/http/run-tests.sh | |
rts-c-tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- name: Install prereqs. | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y libgmp-dev libboost-context-dev | |
sudo apt-get install -y libgtest-dev | |
sudo apt-get install -y cmake | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Build and run tests | |
run: | | |
cmake -B rts-c-tests-build rts-c/tests | |
cmake --build rts-c-tests-build | |
./rts-c-tests-build/rts-c-tests | |