Update TODO #79
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- develop | |
- main | |
permissions: | |
contents: read | |
jobs: | |
config: | |
name: "Load configuration" | |
runs-on: ubuntu-latest | |
outputs: | |
ghcvers: ${{ steps.set-ghcvers.outputs.ghcvers }} | |
ghcvers_lower: ${{ steps.set-ghcvers.outputs.ghcvers_lower }} | |
ghcvers_upper: ${{ steps.set-ghcvers.outputs.ghcvers_upper }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set ghcvers | |
id: set-ghcvers | |
run: ./test-all.sh github >> $GITHUB_OUTPUT | |
cabal: | |
name: "Cabal: GHC ${{ matrix.ghc }}" | |
needs: config | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ${{fromJSON(needs.config.outputs.ghcvers)}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
cabal-update: true | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_OPTS="--enable-tests --enable-benchmarks" | |
if [ -f "cabal-${GHC_VERSION}.project" ] ; then | |
CABAL_OPTS="--project-file=cabal-${GHC_VERSION}.project ${CABAL_OPTS}" | |
fi | |
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Configure Build | |
run: | | |
cabal v2-configure $CABAL_OPTS --disable-documentation | |
cabal v2-build --dry-run $CABAL_OPTS | |
- name: Restore Cached Dependencies | |
uses: actions/cache/restore@v3 | |
id: cache | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Install Dependencies | |
run: cabal v2-build all $CABAL_OPTS --only-dependencies | |
- name: Save Cached Dependencies | |
uses: actions/cache/save@v3 | |
if: ${{ !steps.cache.outputs.cache-hit | |
|| steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: cabal v2-build all $CABAL_OPTS | |
- name: Test | |
run: cabal v2-test all $CABAL_OPTS | |
- name: Haddock | |
run: cabal v2-haddock all $CABAL_OPTS | |
stack: | |
name: "Stack: GHC ${{ matrix.ghc }}" | |
needs: config | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ${{fromJSON(needs.config.outputs.ghcvers)}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
cabal-update: true | |
enable-stack: true | |
stack-version: latest | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
STACK_YAML="stack-${GHC_VERSION}.yaml" | |
echo "STACK_YAML=${STACK_YAML}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-stack-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.stack | |
.stack-work | |
key: ${{ env.CACHE_RESTORE_KEY }}${{ hashFiles('ttc.cabal', env.STACK_YAML) }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Build | |
run: stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks | |
- name: Test | |
run: stack test --system-ghc | |
- name: Haddock | |
run: stack haddock --system-ghc | |
bounds-lower: | |
name: "Lower Bounds (GHC ${{ matrix.ghc }})" | |
needs: config | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ${{fromJSON(needs.config.outputs.ghcvers_lower)}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
cabal-update: true | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_OPTS="--enable-tests --enable-benchmarks --project-file=cabal-bounds-lower.project" | |
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Configure Build | |
run: | | |
cabal v2-configure $CABAL_OPTS --disable-documentation | |
cabal v2-build --dry-run $CABAL_OPTS | |
- name: Restore Cached Dependencies | |
uses: actions/cache/restore@v3 | |
id: cache | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Install Dependencies | |
run: cabal v2-build all $CABAL_OPTS --only-dependencies | |
- name: Save Cached Dependencies | |
uses: actions/cache/save@v3 | |
if: ${{ !steps.cache.outputs.cache-hit | |
|| steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: cabal v2-build all $CABAL_OPTS | |
- name: Test | |
run: cabal v2-test all $CABAL_OPTS | |
- name: Haddock | |
run: cabal v2-haddock all $CABAL_OPTS | |
bounds-upper: | |
name: "Upper Bounds (GHC ${{ matrix.ghc }})" | |
needs: config | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ${{fromJSON(needs.config.outputs.ghcvers_upper)}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
cabal-update: true | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_OPTS="--enable-tests --enable-benchmarks --project-file=cabal-bounds-upper.project" | |
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Configure Build | |
run: | | |
cabal v2-configure $CABAL_OPTS --disable-documentation | |
cabal v2-build --dry-run $CABAL_OPTS | |
- name: Restore Cached Dependencies | |
uses: actions/cache/restore@v3 | |
id: cache | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Install Dependencies | |
run: cabal v2-build all $CABAL_OPTS --only-dependencies | |
- name: Save Cached Dependencies | |
uses: actions/cache/save@v3 | |
if: ${{ !steps.cache.outputs.cache-hit | |
|| steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: cabal v2-build all $CABAL_OPTS | |
- name: Test | |
run: cabal v2-test all $CABAL_OPTS | |
- name: Haddock | |
run: cabal v2-haddock all $CABAL_OPTS | |
cabal-version: | |
name: "Cabal ${{ matrix.cabal }} (GHC ${{ matrix.ghc }})" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
cabal: ['2.4.1.0', '3.0.0.0', '3.2.0.0', '3.4.1.0', '3.6.2.0', '3.8.1.0', '3.10.2.0'] | |
ghc: ['8.2.2'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
cabal-update: true | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_OPTS="--enable-tests --enable-benchmarks" | |
if [ -f "cabal-${GHC_VERSION}.project" ] ; then | |
CABAL_OPTS="--project-file=cabal-${GHC_VERSION}.project ${CABAL_OPTS}" | |
fi | |
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Configure Build | |
run: | | |
cabal v2-configure $CABAL_OPTS --disable-documentation | |
cabal v2-build --dry-run $CABAL_OPTS | |
- name: Restore Cached Dependencies | |
uses: actions/cache/restore@v3 | |
id: cache | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Install Dependencies | |
run: cabal v2-build all $CABAL_OPTS --only-dependencies | |
- name: Save Cached Dependencies | |
uses: actions/cache/save@v3 | |
if: ${{ !steps.cache.outputs.cache-hit | |
|| steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: cabal v2-build all $CABAL_OPTS | |
- name: Test | |
run: cabal v2-test all $CABAL_OPTS | |
- name: Haddock | |
run: cabal v2-haddock all $CABAL_OPTS |