Build Distribution #52
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: Build Distribution | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| test-unit: | |
| name: Unit Tests (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.12', '3.13'] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install backend dependencies | |
| run: cd backend && uv pip install --system -e ".[dev]" | |
| - name: Run backend tests | |
| run: cd backend && pytest -v --tb=short | |
| env: | |
| SECRET_KEY: ci-test-secret-key-do-not-use-in-production | |
| - name: Install frontend dependencies | |
| if: matrix.python-version == '3.12' | |
| run: cd frontend && npm ci | |
| - name: Run frontend unit tests | |
| if: matrix.python-version == '3.12' | |
| run: cd frontend && npm run test:unit -- --run | |
| build-offline: | |
| name: Build Offline (${{ matrix.platform }}) | |
| runs-on: ubuntu-latest | |
| needs: [test-unit] | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| platform: [linux, macos-arm64, macos-x86_64, windows] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Build distribution | |
| run: bash scripts/build-mac-and-linux.sh ${{ matrix.platform }} | |
| - name: Test install (dry-run) | |
| run: bash scripts/test-install-mac-and-linux.sh ${{ matrix.platform }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: roboscope-offline-${{ matrix.platform }} | |
| path: dist/roboscope_offline_${{ matrix.platform }}.zip | |
| retention-days: 7 | |
| build-online: | |
| name: Build (Online) | |
| runs-on: ubuntu-latest | |
| needs: [test-unit] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Build distribution | |
| run: bash scripts/build-online-mac-and-linux.sh | |
| - name: Test online distribution | |
| run: bash scripts/test-dist-mac-and-linux.sh online --skip-build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: roboscope-online | |
| path: dist/roboscope.zip | |
| retention-days: 7 |