|
1 | | -name: "Bob The Builder" |
| 1 | +name: Bob the Builder |
2 | 2 |
|
3 | 3 | on: |
| 4 | + pull_request: |
4 | 5 | push: |
5 | | - branches: [ master ] |
| 6 | + branches: [master] |
6 | 7 |
|
7 | 8 | jobs: |
8 | | - build: |
9 | | - runs-on: ubuntu-latest |
10 | | - container: |
11 | | - image: haskell:9 |
| 9 | + cabal: |
| 10 | + name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + os: [ubuntu-latest, macOS-latest, windows-latest] |
| 15 | + cabal: ["3.4.0.0"] |
| 16 | + ghc: ["8.10.5"] |
| 17 | + |
12 | 18 | steps: |
13 | | - - uses: actions/checkout@v2 |
14 | | - - run: cabal update |
15 | | - - run: sed -i 's/4\.14\.2\.0/4\.15\.0\.0/g' $GITHUB_WORKSPACE/axolotl.cabal |
16 | | - - run: WORKSPACE="$GITHUB_WORKSPACE" bash $GITHUB_WORKSPACE/build.sh |
17 | | - - uses: actions/upload-artifact@v2 |
18 | | - with: |
19 | | - name: axl |
20 | | - path: ${{ github.workspace }}/axl |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + |
| 21 | + - uses: haskell/actions/setup@v1 |
| 22 | + id: setup-haskell-cabal |
| 23 | + name: Setup Haskell |
| 24 | + with: |
| 25 | + ghc-version: ${{ matrix.ghc }} |
| 26 | + cabal-version: ${{ matrix.cabal }} |
| 27 | + enable-stack: false |
| 28 | + |
| 29 | + - name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle |
| 30 | + uses: actions/cache@v2 |
| 31 | + with: |
| 32 | + path: | |
| 33 | + ~/.cabal/packages |
| 34 | + ~/.cabal/store |
| 35 | + ${{ github.workspace }}/dist-newstyle |
| 36 | + key: ${{ runner.os }}-${{ matrix.ghc }} |
| 37 | + |
| 38 | + - name: Update |
| 39 | + run: cabal update |
| 40 | + |
| 41 | + - name: Install dependencies |
| 42 | + run: cabal new-build -O2 --disable-debug-info --enable-executable-stripping --enable-library-stripping --disable-debug-info --disable-library-for-ghci all --only-dependencies |
| 43 | + working-directory: ${{ github.workspace }} |
| 44 | + |
| 45 | + - name: Build |
| 46 | + run: cabal new-build -O2 --disable-debug-info --enable-executable-stripping --enable-library-stripping --disable-debug-info --disable-library-for-ghci all |
| 47 | + working-directory: ${{ github.workspace }} |
| 48 | + |
| 49 | + - name: Copy executable |
| 50 | + run: cp dist-newstyle/build/x86_64-*/ghc-*/axolotl-*/x/axl/opt/build/axl/axl$(if [ "$RUNNER_OS" == "Windows" ]; then echo ".exe"; else echo ""; fi) axl |
| 51 | + shell: bash |
| 52 | + working-directory: ${{ github.workspace }} |
| 53 | + |
| 54 | + - uses: actions/upload-artifact@v2 |
| 55 | + with: |
| 56 | + name: axl-${{ runner.os }} |
| 57 | + path: ${{ github.workspace }}/axl |
0 commit comments