|
1 | 1 | name: Linux
|
2 | 2 |
|
| 3 | +# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. |
| 4 | +concurrency: |
| 5 | + group: ${{ github.head_ref }}-${{ github.workflow }} |
| 6 | + cancel-in-progress: true |
| 7 | + |
3 | 8 | on:
|
4 | 9 | push:
|
5 | 10 | branches:
|
|
11 | 16 |
|
12 | 17 | jobs:
|
13 | 18 | validate:
|
14 |
| - name: Validate ghc-${{ matrix.ghc }} |
| 19 | + name: Validate ubuntu-latest ghc-${{ matrix.ghc }} |
15 | 20 |
|
16 | 21 | runs-on: ubuntu-latest
|
17 | 22 | continue-on-error: ${{ matrix.experimental }}
|
@@ -108,3 +113,68 @@ jobs:
|
108 | 113 | if: matrix.cli == true
|
109 | 114 | run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s cli-suite
|
110 | 115 |
|
| 116 | + validate-old-ghcs: |
| 117 | + name: Validate old ghcs ${{ matrix.extra-ghc }} |
| 118 | + runs-on: ubuntu-18.04 |
| 119 | + needs: validate |
| 120 | + # This job needs an older ubuntu (16.04) cause the needed |
| 121 | + # old ghcs using the `-dyn` flavour are not installable |
| 122 | + # from ppa/hvr in newer ones |
| 123 | + # see https://github.com/haskell/cabal/issues/8011 |
| 124 | + container: |
| 125 | + image: phadej/ghc:8.8.4-xenial |
| 126 | + |
| 127 | + strategy: |
| 128 | + matrix: |
| 129 | + # Newer ghc versions than 8.8.4 has to be installed with ghcup cause |
| 130 | + # they are not available in ppa/hvr. The ghcup installation |
| 131 | + # needs `sudo` which is not available in the xenial container |
| 132 | + ghc: ["8.8.4"] |
| 133 | + extra-ghc: ["7.10.3", "7.8.4", "7.6.3", "7.4.2", "7.2.2", "7.0.4"] |
| 134 | + |
| 135 | + steps: |
| 136 | + |
| 137 | + # We can't use actions/checkout with the xenial docker container |
| 138 | + # cause it does not work with the git version included in it, see: |
| 139 | + # https://github.com/actions/checkout/issues/170 |
| 140 | + # https://github.com/actions/checkout/issues/295 |
| 141 | + # - uses: actions/checkout@v2 |
| 142 | + - name: Checkout |
| 143 | + run: | |
| 144 | + echo $GITHUB_REF $GITHUB_SHA |
| 145 | + git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . |
| 146 | + git fetch origin $GITHUB_SHA:temporary-ci-branch |
| 147 | + git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) |
| 148 | +
|
| 149 | + - name: Install extra compiler |
| 150 | + run: | |
| 151 | + apt-get update |
| 152 | + apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn |
| 153 | +
|
| 154 | + - uses: haskell/actions/setup@v1 |
| 155 | + id: setup-haskell |
| 156 | + with: |
| 157 | + ghc-version: ${{ matrix.ghc }} |
| 158 | + |
| 159 | + # TODO: ideally those jobs should reuse the cabal artifact generated in the |
| 160 | + # previous step. Until that we use the cache generated in the previous step |
| 161 | + # to make the build faster. This job only needs it in read mode. |
| 162 | + - uses: actions/cache@v2 |
| 163 | + with: |
| 164 | + path: | |
| 165 | + ${{ steps.setup-haskell.outputs.cabal-store }} |
| 166 | + dist-newstyle |
| 167 | + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} |
| 168 | + restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- |
| 169 | + |
| 170 | + - name: Install cabal-plan |
| 171 | + run: | |
| 172 | + cd $(mktemp -d) |
| 173 | + cabal install cabal-plan --constraint='cabal-plan +exe' |
| 174 | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH |
| 175 | +
|
| 176 | + - name: Validate build |
| 177 | + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s build |
| 178 | + |
| 179 | + - name: "Validate lib-suite-extras --extra-hc ghc-${{ matrix.extra-ghc }}" |
| 180 | + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v --lib-only -s lib-suite-extras --extra-hc /opt/ghc/${{ matrix.extra-ghc }}/bin/ghc-${{ matrix.extra-ghc }} |
0 commit comments