chore: clarify Go contract map lint scope #88
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: CLI Integration Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| cli-integration: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: opentoggl | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d opentoggl" | |
| --health-interval 5s | |
| --health-timeout 3s | |
| --health-retries 20 | |
| redis: | |
| image: redis:8-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 3s | |
| --health-retries 20 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Check changed files | |
| id: changes | |
| uses: dorny/paths-filter@v4 | |
| with: | |
| filters: | | |
| cli_integration: | |
| - 'apps/backend/**' | |
| - 'packages/**' | |
| - 'lib/**' | |
| - 'openapi/**' | |
| - 'tests/cli-integration/**' | |
| - 'tests/python-sdk-integration/**' | |
| - '.github/workflows/cli-integration.yml' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - 'pnpm-workspace.yaml' | |
| - '.env.example' | |
| - '.air.toml' | |
| - uses: pnpm/action-setup@v6 | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| - uses: actions/setup-node@v6 | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| with: | |
| node-version: 24 | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| run: pnpm install | |
| - name: Build backend | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| env: | |
| CGO_ENABLED: 0 | |
| run: go build -o /tmp/opentoggl ./apps/backend | |
| - name: Start backend | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| env: | |
| OPENTOGGL_SERVICE_NAME: opentoggl-api | |
| PORT: 8080 | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/opentoggl?sslmode=disable | |
| REDIS_URL: redis://127.0.0.1:6379/0 | |
| OPENTOGGL_FILESTORE_NAMESPACE: opentoggl | |
| OPENTOGGL_JOBS_QUEUE_NAME: default | |
| run: | | |
| /tmp/opentoggl & | |
| for i in {1..30}; do | |
| if curl -sf http://localhost:8080/readyz > /dev/null 2>&1; then | |
| echo "Backend is ready" | |
| break | |
| fi | |
| echo "Waiting for backend... ($i/30)" | |
| sleep 2 | |
| done | |
| - name: Install toggl CLI | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| run: | | |
| npm install -g @correctroadh/toggl-cli | |
| toggl --help >/dev/null | |
| - name: Run CLI integration tests | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| env: | |
| OPENTOGGL_CLI_TEST_URL: http://127.0.0.1:8080/api/v9 | |
| OPENTOGGL_CLI_TEST_BASE: http://127.0.0.1:8080 | |
| run: pnpm run test:cli | |
| - name: Setup Python | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Python SDK test dependencies | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| working-directory: tests/python-sdk-integration/toggl-cli | |
| run: pip install -r requirements.txt -r test-requirements.txt | |
| - name: Run Python SDK integration tests | |
| if: steps.changes.outputs.cli_integration == 'true' | |
| working-directory: tests/python-sdk-integration | |
| env: | |
| OPENTOGGL_CLI_TEST_URL: http://127.0.0.1:8080/api/v9 | |
| OPENTOGGL_CLI_TEST_BASE: http://127.0.0.1:8080 | |
| run: python -m pytest -x -v | |
| - name: Skip CLI integration tests | |
| if: steps.changes.outputs.cli_integration != 'true' | |
| run: echo "Skipping CLI integration tests because this change does not touch backend, CLI tests, shared runtime, OpenAPI, dependency, or CI files." |