feat: implement on-chain version tracking and upgrade functionality #128
Workflow file for this run
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: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main, develop] | |
| push: | |
| branches: [main, develop] | |
| env: | |
| NODE_VERSION: "20" | |
| jobs: | |
| changes: | |
| name: Detect changed apps | |
| runs-on: ubuntu-latest | |
| outputs: | |
| backend: ${{ steps.filter.outputs.backend }} | |
| frontend: ${{ steps.filter.outputs.frontend }} | |
| contracts: ${{ steps.filter.outputs.contracts }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| backend: | |
| - 'backend/**' | |
| - 'packages/**' | |
| frontend: | |
| - 'frontend/**' | |
| - 'packages/**' | |
| contracts: | |
| - 'contracts/**' | |
| backend-ci: | |
| name: Backend — Lint, Test, Build | |
| needs: changes | |
| if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.backend == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: stellarsplit_test | |
| ports: ["5432:5432"] | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install dependencies | |
| working-directory: backend | |
| run: npm ci | |
| - name: Lint | |
| working-directory: backend | |
| run: npm run lint | |
| - name: Type check | |
| working-directory: backend | |
| run: npx tsc --noEmit | |
| - name: Unit tests | |
| working-directory: backend | |
| run: npm run test -- --coverage --passWithNoTests | |
| env: | |
| NODE_ENV: test | |
| DB_HOST: localhost | |
| DB_PORT: 5432 | |
| DB_USERNAME: test | |
| DB_PASSWORD: test | |
| DB_NAME: stellarsplit_test | |
| - name: Build | |
| working-directory: backend | |
| run: npm run build | |
| frontend-ci: | |
| name: Frontend — Lint, Test, Build | |
| needs: changes | |
| if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.frontend == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install dependencies | |
| working-directory: frontend | |
| run: npm ci | |
| - name: Lint | |
| working-directory: frontend | |
| run: npm run lint | |
| - name: Type check | |
| working-directory: frontend | |
| run: npx tsc --noEmit | |
| - name: Build | |
| working-directory: frontend | |
| run: npm run build | |
| env: | |
| NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} | |
| contracts-ci: | |
| name: Contracts — Fmt, Test, Build | |
| needs: changes | |
| if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.contracts == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.88.0 | |
| components: rustfmt | |
| targets: wasm32-unknown-unknown | |
| - name: Check formatting | |
| working-directory: contracts | |
| run: bash ./scripts/ci-contracts.sh fmt | |
| - name: Run tests | |
| working-directory: contracts | |
| run: bash ./scripts/ci-contracts.sh test | |
| - name: Build contracts | |
| working-directory: contracts | |
| run: bash ./scripts/ci-contracts.sh build | |
| - name: Upload WASM artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: contract-wasm | |
| path: contracts/target/wasm32-unknown-unknown/release/*.wasm | |
| if-no-files-found: error |