feat: Engine durability hardening + dashboard redesign #59
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| MIX_ENV: test | |
| ELIXIR_VERSION: "1.19" | |
| OTP_VERSION: "28" | |
| jobs: | |
| changes: | |
| name: Detect changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| durable: ${{ steps.filter.outputs.durable }} | |
| dashboard: ${{ steps.filter.outputs.dashboard }} | |
| ci: ${{ steps.filter.outputs.ci }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| durable: | |
| - 'durable/**' | |
| dashboard: | |
| - 'durable/**' | |
| - 'durable_dashboard/**' | |
| ci: | |
| - '.github/workflows/**' | |
| durable: | |
| name: Durable | |
| needs: changes | |
| if: needs.changes.outputs.durable == 'true' || needs.changes.outputs.ci == 'true' || github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:18-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 54321:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U postgres" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| defaults: | |
| run: | |
| working-directory: durable | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| otp-version: ${{ env.OTP_VERSION }} | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: durable/deps | |
| key: ${{ runner.os }}-durable-mix-${{ hashFiles('durable/mix.lock') }} | |
| restore-keys: ${{ runner.os }}-durable-mix- | |
| - name: Restore build cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: durable/_build | |
| key: ${{ runner.os }}-durable-build-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('durable/mix.lock') }} | |
| restore-keys: ${{ runner.os }}-durable-build-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| - name: Compile | |
| run: mix compile --warnings-as-errors | |
| - name: Credo | |
| run: mix credo --strict | |
| - name: Run tests | |
| run: mix test | |
| dashboard: | |
| name: Dashboard | |
| needs: changes | |
| if: needs.changes.outputs.dashboard == 'true' || needs.changes.outputs.ci == 'true' || github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: durable_dashboard | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| otp-version: ${{ env.OTP_VERSION }} | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 9 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20" | |
| cache: pnpm | |
| cache-dependency-path: durable_dashboard/assets/pnpm-lock.yaml | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: durable_dashboard/deps | |
| key: ${{ runner.os }}-dashboard-mix-${{ hashFiles('durable_dashboard/mix.lock', 'durable/mix.lock') }} | |
| restore-keys: ${{ runner.os }}-dashboard-mix- | |
| - name: Restore build cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: durable_dashboard/_build | |
| key: ${{ runner.os }}-dashboard-build-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('durable_dashboard/mix.lock', 'durable/mix.lock') }} | |
| restore-keys: ${{ runner.os }}-dashboard-build-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}- | |
| - name: Install Elixir dependencies | |
| run: mix deps.get | |
| - name: Install JS dependencies | |
| working-directory: durable_dashboard/assets | |
| run: pnpm install --frozen-lockfile | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| - name: Build assets | |
| working-directory: durable_dashboard/assets | |
| run: pnpm build | |
| - name: Compile | |
| run: mix compile --warnings-as-errors | |
| - name: Run tests | |
| run: mix test | |
| ci-status: | |
| name: CI status | |
| needs: [changes, durable, dashboard] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify all required jobs passed | |
| run: | | |
| set -e | |
| [[ "${{ needs.changes.result }}" == "success" ]] || exit 1 | |
| [[ "${{ needs.durable.result }}" =~ ^(success|skipped)$ ]] || exit 1 | |
| [[ "${{ needs.dashboard.result }}" =~ ^(success|skipped)$ ]] || exit 1 |