Accumulated fixes and improvements #208
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: Tests | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Check Go formatting | |
| run: make fmt-check | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: latest | |
| args: --timeout=5m | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install Node.js dependencies | |
| run: npm ci | |
| - name: Lint frontend code | |
| run: make lint-frontend | |
| - name: Check CodeMirror bundle is up to date | |
| run: | | |
| make vendor-codemirror | |
| if ! git diff --quiet -- web/static/vendor/codemirror/codemirror.js; then | |
| echo "::error::CodeMirror bundle is out of date. Run 'make vendor-codemirror' and commit web/static/vendor/codemirror/codemirror.js." | |
| git diff --stat -- web/static/vendor/codemirror/codemirror.js | |
| exit 1 | |
| fi | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: make deps | |
| - name: Build Tailwind CSS | |
| run: make tailwind | |
| - name: Build mock ACP server | |
| run: make build-mock-acp | |
| - name: Run Go unit tests | |
| run: make test-go | |
| - name: Run JavaScript unit tests | |
| run: make test-js | |
| # NOTE: Integration tests use a mock ACP server. | |
| # UI/Playwright tests are excluded - they require a real ACP server and browser. | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: [lint, unit-tests] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: make deps | |
| - name: Build Tailwind CSS | |
| run: make tailwind | |
| - name: Build mock ACP server | |
| run: make build-mock-acp | |
| - name: Build Mitto | |
| run: make build | |
| - name: Run integration tests | |
| run: make test-integration | |
| env: | |
| MITTO_TEST_MODE: '1' | |
| smoke-tests: | |
| name: Smoke Tests (Docker) | |
| runs-on: ubuntu-latest | |
| needs: [lint, unit-tests] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install Node.js dependencies | |
| run: npm ci | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ hashFiles('package-lock.json') }} | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Run smoke tests | |
| continue-on-error: true # Smoke tests are informational while we stabilize CI timing | |
| run: make smoke-test | |
| - name: Upload test results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: smoke-test-results | |
| path: tests/ui/test-results/ | |
| retention-days: 7 |