|  | 
|  | 1 | +name: github-action | 
|  | 2 | + | 
|  | 3 | +on: [push, pull_request] | 
|  | 4 | + | 
|  | 5 | +jobs: | 
|  | 6 | +  build: | 
|  | 7 | +    strategy: | 
|  | 8 | +      fail-fast: false | 
|  | 9 | +      matrix: | 
|  | 10 | +        ghc: ['8.6', '8.8', '8.10', '9.0', '9.2', '9.4', '9.6', '9.8', '9.10'] | 
|  | 11 | +        os: ['ubuntu-latest', 'macos-13'] # https://github.com/haskell-actions/setup/issues/77 | 
|  | 12 | +    runs-on: ${{ matrix.os }} | 
|  | 13 | + | 
|  | 14 | +    name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} | 
|  | 15 | +    steps: | 
|  | 16 | +    - uses: actions/checkout@v4 | 
|  | 17 | +    - uses: haskell-actions/setup@v2 | 
|  | 18 | +      with: | 
|  | 19 | +        ghc-version: ${{ matrix.ghc }} | 
|  | 20 | +    - name: Cache | 
|  | 21 | +      uses: actions/cache@v3 | 
|  | 22 | +      env: | 
|  | 23 | +        cache-name: cache-cabal | 
|  | 24 | +      with: | 
|  | 25 | +        path: ~/.cabal | 
|  | 26 | +        key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | 
|  | 27 | +        restore-keys: | | 
|  | 28 | +          ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}- | 
|  | 29 | +          ${{ runner.os }}-${{ matrix.ghc }}-build- | 
|  | 30 | +          ${{ runner.os }}-${{ matrix.ghc }}- | 
|  | 31 | +          ${{ runner.os }} | 
|  | 32 | +
 | 
|  | 33 | +    - name: Install system packages (linux) | 
|  | 34 | +      if: matrix.os == 'ubuntu-latest' | 
|  | 35 | +      run: | | 
|  | 36 | +        sudo apt-get update | 
|  | 37 | +        sudo apt install libsodium-dev | 
|  | 38 | +
 | 
|  | 39 | +    - name: Install system packages (macos) | 
|  | 40 | +      if: matrix.os == 'macos-13' | 
|  | 41 | +      run: | | 
|  | 42 | +        brew update | 
|  | 43 | +        brew install libsodium | 
|  | 44 | +
 | 
|  | 45 | +    - name: Set up cabal project file for CI | 
|  | 46 | +      run: cd lib && cp cabal.project.ci cabal.project | 
|  | 47 | + | 
|  | 48 | +    - name: Install dependencies | 
|  | 49 | +      run: | | 
|  | 50 | +        cabal update | 
|  | 51 | +        cd lib && cabal build --only-dependencies --enable-tests --enable-benchmarks all | 
|  | 52 | +    - name: Build obelisk libraries | 
|  | 53 | +      run: cd lib && cabal build --enable-tests --enable-benchmarks all | 
|  | 54 | +    - name: Run tests | 
|  | 55 | +      run: cd lib && cabal test all | 
0 commit comments