Optimise IOSim & IOSimPOR #496
Workflow file for this run
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: ["main"] | |
pull_request: | |
merge_group: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ["8.10", "9.2", "9.4", "9.6", "9.8"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
defaults: | |
run: | |
shell: 'bash' | |
steps: | |
- name: Set cache version | |
run: echo "CACHE_VERSION=pu4Aevoo_v1" >> $GITHUB_ENV | |
- name: "Setup Haskell" | |
uses: haskell-actions/setup@v2 | |
id: setup-haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: "3.10.1.0" | |
- uses: actions/checkout@v3 | |
- name: "Configure cabal.project.local" | |
run: | | |
cat ./.github/workflows/cabal.project.local > ./cabal.project.local | |
cat ./cabal.project.local | |
- name: "Cabal update" | |
run: cabal update | |
- name: Record dependencies | |
id: record-deps | |
run: | | |
cabal build all --dry-run | |
cat dist-newstyle/cache/plan.json | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt | |
echo "weeknum=$(/bin/date -u "+%W")" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: "Cache cabal store" | |
with: | |
path: ${{ runner.os == 'Windows' && steps.win-setup-haskell.outputs.cabal-store || steps.setup-haskell.outputs.cabal-store }} | |
key: cache-dependencies-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }} | |
restore-keys: cache-dependencies-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }} | |
- uses: actions/cache@v3 | |
name: "Cache `dist-newstyle`" | |
with: | |
path: | | |
dist-newstyle | |
!dist-newstyle/**/.git | |
key: cache-dist-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ steps.record-deps.outputs.weeknum }} | |
restore-keys: cache-dist-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }} | |
- name: Build dependencies | |
run: | | |
cabal build --only-dependencies all | |
- name: Build projects [build] | |
run: cabal build all | |
- name: Build documentation [haddock] | |
run: cabal haddock all | |
- name: io-sim [test] | |
run: cabal run io-sim:test | |
- name: si-timers [test] | |
run: cabal run si-timers:test | |
- name: strict-mvar [test] | |
run: cabal run strict-mvar:test | |
stylish-haskell: | |
runs-on: ubuntu-22.04 | |
env: | |
STYLISH_HASKELL_VERSION: "0.14.4.0" | |
steps: | |
- name: Set cache version | |
run: | | |
echo "CACHE_VERSION=hi5eTh3A" >> $GITHUB_ENV | |
- name: "Install build environment (apt-get)" | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install fd-find | |
- name: "Setup Haskell" | |
uses: haskell-actions/setup@v2 | |
id: setup-haskell | |
with: | |
ghc-version: 9.6.3 | |
cabal-version: 3.10.1.0 | |
- name: "Setup cabal bin path" | |
run: | | |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH | |
- uses: actions/cache@v3 | |
name: "Cache cabal store" | |
with: | |
path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
key: cache-dependencies-${{ env.CACHE_VERSION }} | |
- name: Download stylish-haskell | |
run: | | |
version="${{ env.STYLISH_HASKELL_VERSION }}" | |
curl -sL \ | |
"https://github.com/haskell/stylish-haskell/releases/download/v$version/stylish-haskell-v$version-linux-x86_64.tar.gz" \ | |
| tar -C "/tmp" -xz | |
echo "PATH=/tmp/stylish-haskell-v$version-linux-x86_64:$PATH" >> $GITHUB_ENV | |
- name: "`stylish-haskell` version" | |
run: | | |
which stylish-haskell | |
stylish-haskell --version | |
- uses: actions/checkout@v3 | |
- name: "Run `stylish-haskell`" | |
run: | | |
./scripts/check-stylish.sh | |
git diff --exit-code |