|
| 1 | +name: copilot-verifier |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +env: |
| 9 | + SOLVER_PKG_VERSION: "snapshot-20221212" |
| 10 | + # The CACHE_VERSION can be updated to force the use of a new cache if |
| 11 | + # the current cache contents become corrupted/invalid. This can |
| 12 | + # sometimes happen when (for example) the OS version is changed but |
| 13 | + # older .so files are cached, which can have various effects |
| 14 | + # (e.g. cabal complains it can't find a valid version of the "happy" |
| 15 | + # tool). |
| 16 | + CACHE_VERSION: 1 |
| 17 | + LLVM_VERSION: 12 |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + runs-on: ${{ matrix.os }} |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + os: [ubuntu-22.04] |
| 26 | + ghc-version: ["8.10.7", "9.0.2", "9.2.7"] |
| 27 | + cabal: [ '3.8.1.0' ] |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v2 |
| 30 | + with: |
| 31 | + submodules: true |
| 32 | + |
| 33 | + - uses: haskell/actions/setup@v1 |
| 34 | + id: setup-haskell |
| 35 | + with: |
| 36 | + ghc-version: ${{ matrix.ghc-version }} |
| 37 | + cabal-version: ${{ matrix.cabal }} |
| 38 | + |
| 39 | + - uses: actions/cache/restore@v3 |
| 40 | + name: Restore cabal store cache |
| 41 | + with: |
| 42 | + path: | |
| 43 | + ${{ steps.setup-haskell.outputs.cabal-store }} |
| 44 | + dist-newstyle |
| 45 | + key: ${{ env.CACHE_VERSION }}-cabal-${{ matrix.os }}-${{ matrix.ghc-version }}-${{ hashFiles(format('cabal.GHC-{0}.config', matrix.ghc-version)) }}-${{ github.sha }} |
| 46 | + restore-keys: | |
| 47 | + ${{ env.CACHE_VERSION }}-cabal-${{ matrix.os }}-${{ matrix.ghc-version }}-${{ hashFiles(format('cabal.GHC-{0}.config', matrix.ghc-version)) }}- |
| 48 | +
|
| 49 | + - shell: bash |
| 50 | + name: Install system dependencies |
| 51 | + run: .github/ci.sh install_system_deps |
| 52 | + env: |
| 53 | + BIN_ZIP_FILE: ${{ matrix.os }}-bin.zip |
| 54 | + BUILD_TARGET_OS: ${{ matrix.os }} |
| 55 | + |
| 56 | + - shell: bash |
| 57 | + name: Update |
| 58 | + run: cabal update |
| 59 | + |
| 60 | + - shell: bash |
| 61 | + name: Configure |
| 62 | + run: cabal configure --enable-tests -j2 all |
| 63 | + |
| 64 | + - shell: bash |
| 65 | + name: Build copilot-verifier |
| 66 | + run: cabal build pkg:copilot-verifier |
| 67 | + |
| 68 | + - shell: bash |
| 69 | + name: Build copilot-verifier-demo |
| 70 | + run: cabal build pkg:copilot-verifier-demo |
| 71 | + |
| 72 | + - shell: bash |
| 73 | + name: Test copilot-verifier |
| 74 | + run: cabal test pkg:copilot-verifier |
| 75 | + |
| 76 | + - uses: actions/cache/save@v3 |
| 77 | + name: Save cabal store cache |
| 78 | + if: always() |
| 79 | + with: |
| 80 | + path: | |
| 81 | + ${{ steps.setup-haskell.outputs.cabal-store }} |
| 82 | + dist-newstyle |
| 83 | + key: ${{ env.CACHE_VERSION }}-cabal-${{ matrix.os }}-${{ matrix.ghc-version }}-${{ hashFiles(format('cabal.GHC-{0}.config', matrix.ghc-version)) }}-${{ github.sha }} |
0 commit comments