Merge pull request #5 from pragma-org/read-ledgerdb-config #65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Haskell CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ linux, macos ] | |
| arch: [ x86_64, aarch64 ] | |
| exclude: | |
| - os: macos | |
| arch: x86_64 | |
| runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-latest' || (matrix.os == 'linux' && 'ubuntu-24.04-arm' || 'macos-latest') }} | |
| steps: | |
| - name: π₯ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: β Tag build artifacts | |
| id: tag | |
| shell: bash | |
| run: | | |
| echo "value=$GIT_SHA" >> $GITHUB_OUTPUT | |
| env: | |
| GIT_SHA: ${{ github.sha }} | |
| - name: π Setup GHC | |
| uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: '9.4.8' | |
| cabal-version: '3.12.1.0' | |
| - name: β Cache | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-cabal | |
| with: | |
| path: | | |
| ~/.cabal | |
| ~/.local | |
| key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-${{ runner.arch }}-build- | |
| ${{ runner.os }}-${{ runner.arch }}- | |
| - name: π Prepare OS | |
| if: ${{ matrix.os == 'macos' }} | |
| run: | | |
| brew install autoconf automake libtool | |
| - name: π Build | |
| run: | | |
| ./build.hs | |
| tar cvf artifact.tar -C bin db-server | |
| - name: π’ Upload archive | |
| uses: actions/upload-artifact@v4.4.0 | |
| with: | |
| name: db-server-${{ steps.tag.outputs.value }}-${{ matrix.arch }}-${{ matrix.os }} | |
| path: artifact.tar | |
| overwrite: true |