build(deps): bump actions/checkout from 6 to 7 (#155) #13
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: SDK CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "sdks/**" | |
| - ".github/workflows/sdk-ci.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "sdks/**" | |
| - ".github/workflows/sdk-ci.yml" | |
| jobs: | |
| python-sdk: | |
| name: Python SDK — Lint, Type, Test, Build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: sdks/python | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| cache-dependency-path: sdks/python/pyproject.toml | |
| - name: Install | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" build | |
| - name: Ruff lint | |
| run: ruff check . | |
| - name: Ruff format check | |
| run: ruff format --check . | |
| - name: mypy | |
| run: mypy mailcue | |
| - name: pytest | |
| run: pytest -q | |
| - name: Build sdist + wheel | |
| run: python -m build | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: python-sdk-dist | |
| path: sdks/python/dist/* | |
| retention-days: 7 | |
| node-sdk: | |
| name: Node SDK — Lint, Type, Test, Build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: sdks/node | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: sdks/node/package-lock.json | |
| - name: Install | |
| run: npm ci | |
| - name: ESLint | |
| run: npm run lint | |
| - name: TypeScript | |
| run: npm run typecheck | |
| - name: Vitest | |
| run: npm run test | |
| - name: Build | |
| run: npm run build | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: node-sdk-dist | |
| path: sdks/node/dist/* | |
| retention-days: 7 | |
| e2e: | |
| name: SDK E2E — Live MailCue | |
| runs-on: ubuntu-latest | |
| needs: [python-sdk, node-sdk] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Build mailcue image | |
| run: docker build -t mailcue:e2e . | |
| - name: Start mailcue | |
| run: | | |
| docker run -d --name mailcue \ | |
| -p 8088:80 \ | |
| -p 25:25 -p 587:587 \ | |
| -p 143:143 -p 993:993 \ | |
| -e MAILCUE_DOMAIN=mailcue.local \ | |
| -e MAILCUE_ADMIN_USER=admin \ | |
| -e MAILCUE_ADMIN_PASSWORD=mailcue \ | |
| mailcue:e2e | |
| - name: Wait for /health | |
| run: | | |
| for i in $(seq 1 90); do | |
| if curl -sf http://localhost:8088/api/v1/health > /dev/null; then | |
| echo "mailcue ready after ${i}s" | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo "mailcue did not become healthy in 180s" | |
| docker logs mailcue --tail 200 | |
| exit 1 | |
| - name: Provision API key | |
| id: provision | |
| run: | | |
| TOKEN=$(curl -sf -X POST http://localhost:8088/api/v1/auth/login \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"username":"admin","password":"mailcue"}' | python -c "import sys,json;print(json.load(sys.stdin)['access_token'])") | |
| API_KEY=$(curl -sf -X POST http://localhost:8088/api/v1/auth/api-keys \ | |
| -H "Authorization: Bearer $TOKEN" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"name":"sdk-e2e"}' | python -c "import sys,json;d=json.load(sys.stdin);print(d.get('key') or d.get('api_key') or d.get('plaintext') or '')") | |
| if [ -z "$API_KEY" ]; then | |
| echo "Failed to provision API key" | |
| exit 1 | |
| fi | |
| echo "::add-mask::$API_KEY" | |
| echo "key=$API_KEY" >> "$GITHUB_OUTPUT" | |
| - name: Install Python SDK | |
| working-directory: sdks/python | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Run Python E2E | |
| env: | |
| MAILCUE_API_KEY: ${{ steps.provision.outputs.key }} | |
| run: python sdks/_e2e/python_e2e.py | |
| - name: Build Node SDK | |
| working-directory: sdks/node | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Run Node E2E | |
| env: | |
| MAILCUE_API_KEY: ${{ steps.provision.outputs.key }} | |
| run: node sdks/_e2e/node_e2e.mjs | |
| - name: Container logs on failure | |
| if: failure() | |
| run: docker logs mailcue --tail 400 | |
| - name: Stop mailcue | |
| if: always() | |
| run: docker rm -f mailcue || true |