This repository was archived by the owner on Jun 12, 2026. It is now read-only.
fixed database config, migrations #14
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: Level2 CI | |
| on: | |
| push: | |
| branches: [ "main", "ci" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| # env: | |
| # GHCUP_INSTALL_BASE_PREFIX: /home/runner/.ghcup-build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install System Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | |
| libpq-dev \ | |
| pkg-config \ | |
| ca-certificates | |
| sudo rm -rf /var/lib/apt/lists/* | |
| - name: PG_config version check | |
| run: pg_config --version | |
| # # ✅ Cache GHCup BEFORE setup | |
| # - name: Cache GHCup | |
| # id: ghc-cache | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: | | |
| # /home/runner/.ghcup | |
| # key: ${{ runner.os }}-ghc-9.6.7-v3 # <- bump to avoid old invalid empty cache | |
| - name: Set up Haskell | |
| uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: "9.6.7" | |
| cabal-version: "3.10.3.0" | |
| # - name: Check GHCUP Cache | |
| # run: | | |
| # echo " -- check .ghcup --" | |
| # ls -ahl ~/.ghcup | |
| # echo " -- check .ghcup-build | |
| # ls -ahl /home/runner/.ghcup-build | |
| - uses: actions/cache@v4 | |
| id: cabal-cache | |
| with: | |
| path: | | |
| ~/.cabal/store | |
| dist-newstyle | |
| key: ${{ runner.os }}-ghc96-${{ hashFiles('**/*.cabal', '**/cabal.project*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-ghc96- | |
| - name: Install dependencies | |
| run: | | |
| cabal update | |
| cabal build --only-dependencies --enable-tests --enable-benchmarks | |
| - name: Build and Test | |
| run: | | |
| cabal build --enable-tests --enable-benchmarks all | |
| cabal test --test-show-details=direct | |
| docker: | |
| needs: test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Artifactory | |
| run: | | |
| echo "${{ secrets.ARTIFACTORY_PASSWORD }}" | \ | |
| docker login "${{ vars.ARTIFACTORY }}" \ | |
| --username "${{ secrets.ARTIFACTORY_USER }}" \ | |
| --password-stdin | |
| - name: Short Git Commit SHA | |
| id: vars | |
| run: | | |
| calculatedSha=$(git rev-parse --short ${{ github.sha }}) | |
| echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV | |
| - name: Confirm git commit SHA output | |
| run: echo ${{ env.COMMIT_SHORT_SHA }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{vars.ARTIFACTORY}}/level2:${{vars.VERSION_PREFIX}}.${{github.run_number}} | |
| ${{vars.ARTIFACTORY}}/level2:${{vars.VERSION_PREFIX}}.${{env.COMMIT_SHORT_SHA}} | |
| ${{vars.ARTIFACTORY}}/level2:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |