diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 4989eb4..c3a1f36 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -1,30 +1,34 @@ -name: Haskell CI -on: - - push +# This file is generated by `generate.sh`. +# Generated from https://github.com/bellroy/gha-workflows/tree/master/dhall/workflows/timeline/haskell-ci.dhall +# Think twice before editing it directly. jobs: generate-matrix: - name: "Generate matrix from cabal" + name: Generate matrix from cabal outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} + matrix: "${{ steps.set-matrix.outputs.matrix }}" runs-on: ubuntu-20.04 steps: - - name: Extract the tested GHC versions - id: set-matrix - uses: kleidukos/get-tested@a0aa3f2d4ab0d10daa49dc9ee8c706d673fb0e02 + - id: set-matrix + name: Extract the tested GHC versions + uses: "kleidukos/get-tested@a0aa3f2d4ab0d10daa49dc9ee8c706d673fb0e02" with: cabal-file: timeline.cabal - ubuntu-version: "20.04" - version: 0.1.7.1 + ubuntu-version: '20.04' + version: '0.1.7.1' + timeout-minutes: 30 tests: - name: ${{ matrix.ghc }} on ${{ matrix.os }} - needs: generate-matrix - runs-on: ${{ matrix.os }} container: image: buildpack-deps:jammy - strategy: - matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} + name: "${{ matrix.ghc }} on ${{ matrix.os }}" + needs: + - generate-matrix + runs-on: "${{ matrix.os }}" steps: - - name: apt + - env: + HCKIND: ghc + HCNAME: "ghc-${{ matrix.ghc }}" + HCVER: "${{ matrix.ghc }}" + name: apt run: | apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 @@ -33,11 +37,11 @@ jobs: chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - env: + - env: HCKIND: ghc - HCNAME: ghc-${{ matrix.ghc }} - HCVER: ${{ matrix.ghc }} - - name: Set PATH and environment variables + HCNAME: "ghc-${{ matrix.ghc }}" + HCVER: "${{ matrix.ghc }}" + name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH echo "LANG=C.UTF-8" >> "$GITHUB_ENV" @@ -58,13 +62,8 @@ jobs: echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" echo "GHCJSARITH=0" >> "$GITHUB_ENV" - env: - HCKIND: ghc - HCNAME: ghc-${{ matrix.ghc }} - HCVER: ${{ matrix.ghc }} - name: env - run: | - env + run: env - name: write cabal config run: | mkdir -p $CABAL_DIR @@ -95,13 +94,12 @@ jobs: $HC --print-project-git-commit-id || true $CABAL --version || true - name: update cabal index - run: | - $CABAL v2-update -v - - name: cache (tools) - uses: actions/cache/restore@v4 + run: "$CABAL v2-update -v" + - name: "cache (tools)" + uses: "actions/cache/restore@v4" with: - key: ${{ runner.os }}-${{ matrix.ghc }}-tools-ac1dc7e1 - path: ~/.haskell-ci-tools + key: "${{ runner.os }}-${{ matrix.ghc }}-tools-ac1dc7e1" + path: "~/.haskell-ci-tools" - name: install cabal-plan run: | mkdir -p $HOME/.cabal/bin @@ -115,14 +113,14 @@ jobs: run: | $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' doctest --version - - name: save cache (tools) - uses: actions/cache/save@v4 - if: always() + - if: "always()" + name: "save cache (tools)" + uses: "actions/cache/save@v4" with: - key: ${{ runner.os }}-${{ matrix.ghc }}-tools-ac1dc7e1 - path: ~/.haskell-ci-tools + key: "${{ runner.os }}-${{ matrix.ghc }}-tools-ac1dc7e1" + path: "~/.haskell-ci-tools" - name: checkout - uses: actions/checkout@v4 + uses: "actions/checkout@v4" with: path: source - name: initial cabal.project for sdist @@ -140,12 +138,12 @@ jobs: find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; - name: generate cabal.project run: | - PKGDIR_timeline="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/timeline-[0-9.]*')" - echo "PKGDIR_timeline=${PKGDIR_timeline}" >> "$GITHUB_ENV" + PKGDIR_PROJECT="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/timeline-[0-9.]*')" + echo "PKGDIR_PROJECT=${PKGDIR_PROJECT}" >> "$GITHUB_ENV" rm -f cabal.project cabal.project.local touch cabal.project touch cabal.project.local - echo "packages: ${PKGDIR_timeline}" >> cabal.project + echo "packages: ${PKGDIR_PROJECT}" >> cabal.project echo "package timeline" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <