3 # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
5 group: ${{ github.ref }}-${{ github.workflow }}
6 cancel-in-progress: true
15 # only top level for these, because various test packages have them too
36 # Dogfood the generated sdist, to avoid bugs like https://github.com/haskell/cabal/issues/9833
37 # No caching, since the point is to verify they can be installed "from scratch"
38 # Don't run on master or a PR targeting master, because there's never an installable Cabal
40 name: Dogfood sdist on ghc-${{ matrix.ghc }}
41 if: github.ref != 'refs/heads/master' && github.base_ref != 'master'
42 runs-on: ubuntu-latest
45 # this should be kept up to date with the list in validate.yml, but should be the
46 # *first* compiler release so we validate against what is hopefully the first
47 # release of a corresponding Cabal and friends. it can also be short since it's
48 # highly unlikely that we are releasing really old branches.
50 ["9.10.1", "9.8.1", "9.6.1"]
54 - uses: haskell-actions/setup@v2
57 ghc-version: ${{ matrix.ghc }}
60 - uses: actions/checkout@v4
63 run: cabal sdist cabal-install
65 - name: Install from sdist
67 # skip if a suitable Cabal isn't in this ghc's bootlibs, since that's the case
68 # that causes failures for users (otherwise cabal-install will install a matching
70 # we only want to test cabal-install, to ensure that it works with existing Cabals
71 # (don't look at this too closely)
72 sdist="$(ls dist-newstyle/sdist/cabal-install-*.tar.gz | sed -n '\,^dist-newstyle/sdist/cabal-install-[0-9.]*\.tar\.gz$,{;p;q;}')"
73 # extract the cabal-install major version
74 ver="$(echo "$sdist" | sed -n 's,^dist-newstyle/sdist/cabal-install-\([0-9][0-9]*\.[0-9][0-9]*\)\.[0-9.]*$,\1,p')"
75 # dunno if this will ever be extended to freebsd, but grep -q is a gnu-ism
76 if ghc-pkg --global --simple-output list Cabal | grep "^Cabal-$cbl\\." >/dev/null; then
77 # sigh, someone broke installing from tarballs
78 rm -rf cabal*.project Cabal Cabal-syntax cabal-install-solver cabal-install
80 cd "cabal-install-$cbl"*
83 echo No matching bootlib Cabal version to test against.
89 name: Check sdist post job
90 runs-on: ubuntu-latest
91 # IMPORTANT! Any job added to the workflow should be added here too
92 needs: [dogfood-sdists]
96 echo "jobs info: ${{ toJSON(needs) }}"
97 - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')