Merge pull request #26 from GaloisInc/lcasburn-data-rights #99
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
# This CI configuration is inspired by | |
# | |
# https://kodimensional.dev/github-actions | |
name: CI Matrix | |
# Trigger the workflow on push or pull request, but only for the master branch | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
env: | |
LANG: en_US.UTF-8 | |
LC_ALL: en_US.UTF-8 | |
TZ: America/Los_Angeles | |
CACHE_VERSION: 1 | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ['8.8.4', '8.10.7'] | |
cabal: ['3.6.0.0'] | |
os: [self-hosted] | |
name: MCTrace (full) on GHC ${{ matrix.ghc }} / ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
# This is necessary to support caching with cabal. If we build directly from | |
# submodules, cabal will not use the cache for them due to mtime | |
# differences. Instead, we convert our submodules into cabal's "source | |
# repositories", which are actually built into the cabal store | |
# instead. While that shouldn't make a difference, packages in the store are | |
# only rebuilt based on hashes and not mtimes, which means that they are | |
# actually reused from the cache. | |
- name: Convert Submodules to Source Repos | |
run: | | |
git config --global url."https://github.com/".insteadOf "git@github.com:" | |
git config --global url."https://".insteadOf "git://" | |
curl -sL https://github.com/RyanGlScott/submods-to-source-repos/releases/download/0.0.0.20211210/submods-to-source-repos-0.0.0.20211210.xz > submods-to-source-repos.xz | |
echo 'f339f4bbe43af96df7e8ce115377e56f4861bab5c8f66d3129492cbe7695bbac submods-to-source-repos.xz' | sha256sum -c - | |
xz -d < submods-to-source-repos.xz > submods-to-source-repos | |
rm -f submods-to-source-repos.xz | |
chmod a+x submods-to-source-repos | |
./submods-to-source-repos cabal.project.dist > cabal.project | |
echo "Constructed cabal.project:" | |
cat cabal.project | |
- name: Installing the freeze file | |
run: mv cabal.project.freeze.ghc-${{ matrix.ghc }} cabal.project.freeze | |
- uses: actions/cache@v2 | |
name: Cache cabal store | |
with: | |
path: | | |
~/.cabal/store | |
~/.cabal/packages | |
~/.ghcup | |
dist-newstyle | |
# Our key is the freeze file and also the (constructed) | |
# cabal.project. This captures the normal package dependencies *and* the | |
# submodule hashes (without capturing anything undesirable) | |
key: ${{ env.CACHE_VERSION }}-pate-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze', 'cabal.project') }} | |
restore-keys: | | |
${{ env.CACHE_VERSION }}-pate-${{ runner.os }}-${{ matrix.ghc }}- | |
- uses: haskell/actions/setup@v1 | |
id: setup-haskell | |
name: Setup Haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
- name: System Dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y software-properties-common apt-transport-https ca-certificates wget | |
sudo apt install -y curl zlibc zlib1g zlib1g-dev git zip \ | |
libgmp3-dev build-essential libtinfo-dev autoconf automake gperf cmake locales \ | |
python3-distutils python-setuptools antlr3 libantlr3c-dev libtool libtool-bin libboost-all-dev python3-pip libfftw3-dev \ | |
language-pack-en-base language-pack-en llvm-12-dev llvm-12-runtime | |
sudo locale-gen en_US.UTF-8 | |
sudo update-locale LANG=$LANG LANGUAGE=$LANGUAGE | |
- name: Build Haskell Dependencies | |
run: | | |
cabal configure --write-ghc-environment-files=always --enable-tests --test-show-details=direct -j | |
cabal build pkg:mctrace --only-dependencies | |
- name: Build MCTrace | |
run: | | |
cabal build pkg:mctrace | |
- name: Test MCTrace | |
run: | | |
cabal test pkg:mctrace |