name: CI on: workflow_dispatch: push: branches: [main] paths-ignore: - "README.md" - "CONTRIBUTING.md" - "branding/**" - "apps/docs/**" - "apps/landing/**" - "docs/**" pull_request: branches: [main] paths-ignore: - "README.md" - "CONTRIBUTING.md" - "branding/**" - "apps/docs/**" - "apps/landing/**" - "docs/**" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: lint: name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./.github/actions/setup - run: pnpm lint typecheck: name: Typecheck runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./.github/actions/setup - run: pnpm typecheck test-unit: name: Unit Tests runs-on: ubuntu-latest timeout-minutes: 5 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Install system dependencies (HEIC + ExifTool + ImageMagick + exotic format tools) run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends libheif-examples libheif-plugin-x265 libheif-plugin-libde265 libimage-exiftool-perl imagemagick ghostscript libjxl-tools libopenjp2-tools - uses: ./.github/actions/setup - run: pnpm vitest run tests/unit/ --reporter=verbose test-integration: name: Integration (${{ matrix.shard }}/4) runs-on: ubuntu-latest timeout-minutes: 30 strategy: fail-fast: false matrix: shard: [1, 2, 3, 4] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Install system dependencies (HEIC + ExifTool + ImageMagick + exotic format tools) run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends libheif-examples libheif-plugin-x265 libheif-plugin-libde265 libimage-exiftool-perl imagemagick ghostscript libjxl-tools libopenjp2-tools - name: Allow ImageMagick to read EPS/PS via Ghostscript delegate run: | POLICY_FILE=$(find /etc/ImageMagick* -name policy.xml 2>/dev/null | head -1) if [ -n "$POLICY_FILE" ]; then sudo sed -i 's/- pip-audit -r packages/ai/python/requirements.txt --ignore-vuln CVE-2024-27763 --ignore-vuln CVE-2026-40086 --ignore-vuln CVE-2026-25990 --ignore-vuln CVE-2026-40192 --ignore-vuln GHSA-55v6-g8pm-pw4c --ignore-vuln CVE-2026-42308 --ignore-vuln CVE-2026-42310 --ignore-vuln CVE-2026-42311 build: name: Build runs-on: ubuntu-latest needs: [lint, typecheck, test-unit, test-integration] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./.github/actions/setup - run: pnpm build # docker: # name: Docker Build Test # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v4 # - uses: docker/setup-buildx-action@v3 # - name: Log in to GHCR (for registry cache) # uses: docker/login-action@v3 # with: # registry: ghcr.io # username: ${{ github.repository_owner }} # password: ${{ secrets.GHCR_TOKEN }} # - uses: docker/build-push-action@v6 # with: # context: . # file: docker/Dockerfile # push: false # tags: snapotter:ci # build-args: SKIP_MODEL_DOWNLOADS=true # cache-from: type=registry,ref=ghcr.io/snapotter-hq/snapotter:cache-linux-amd64 # cache-to: type=registry,ref=ghcr.io/snapotter-hq/snapotter:cache-ci,mode=max