diff --git a/.github/workflows/companion-lint.yml b/.github/workflows/companion-lint.yml new file mode 100644 index 0000000000..6b4ad4d57f --- /dev/null +++ b/.github/workflows/companion-lint.yml @@ -0,0 +1,33 @@ +name: Companion Lint + +on: + workflow_call: + +permissions: + contents: read + +jobs: + lint: + name: Lint Companion App + runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: .github + - uses: ./.github/actions/cache-checkout + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: 1.3.0 + cache: false + + - name: Install dependencies + working-directory: companion + run: bun install --frozen-lockfile + + - name: Run lint + working-directory: companion + run: bun run lint:all diff --git a/.github/workflows/companion-typecheck.yml b/.github/workflows/companion-typecheck.yml new file mode 100644 index 0000000000..9911a9012c --- /dev/null +++ b/.github/workflows/companion-typecheck.yml @@ -0,0 +1,34 @@ +name: Companion Type Check + +on: + workflow_call: + +permissions: + contents: read + +jobs: + typecheck: + name: Type Check Companion App + runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: .github + - uses: ./.github/actions/cache-checkout + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: 1.3.0 + cache: true + cache-dependency-path: companion/bun.lock + + - name: Install dependencies + working-directory: companion + run: bun install --frozen-lockfile + + - name: Type check + working-directory: companion + run: bun run typecheck:all diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 552a0e59af..aa36e440ed 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -299,7 +299,7 @@ jobs: skip-install-if-cache-hit: "true" type-check: - name: Type check + name: Type Checks needs: [prepare] if: ${{ needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/check-types.yml @@ -377,6 +377,20 @@ jobs: uses: ./.github/workflows/companion-build.yml secrets: inherit + typecheck-companion: + name: Type Checks + needs: [prepare] + if: needs.prepare.outputs.has-companion == 'true' + uses: ./.github/workflows/companion-typecheck.yml + secrets: inherit + + lint-companion: + name: Linters + needs: [prepare] + if: needs.prepare.outputs.has-companion == 'true' + uses: ./.github/workflows/companion-lint.yml + secrets: inherit + build: name: Production builds needs: [prepare] @@ -457,6 +471,8 @@ jobs: build-atoms, build-docs, build-companion, + typecheck-companion, + lint-companion, setup-db, e2e, e2e-api-v2, @@ -506,5 +522,9 @@ jobs: ) || ( needs.prepare.outputs.has-companion == 'true' && - needs.build-companion.result != 'success' + ( + needs.build-companion.result != 'success' || + needs.typecheck-companion.result != 'success' || + needs.lint-companion.result != 'success' + ) )