diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml new file mode 100644 index 0000000..06c7309 --- /dev/null +++ b/.github/workflows/pr_quality.yml @@ -0,0 +1,76 @@ +name: PR Quality Checks + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + rust-quality: + name: Rust format, lint, and test + # The product is currently macOS-first and Tauri's Linux build needs extra + # WebKit/GTK system packages that are not part of this basic quality lane. + runs-on: macos-14 + timeout-minutes: 30 + steps: + - name: Check out repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + - name: Check formatting + run: cargo fmt --all -- --check + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 22 + cache: npm + cache-dependency-path: ui/package-lock.json + - name: Install UI dependencies + working-directory: ui + run: npm ci + - name: Build embedded UI assets + working-directory: ui + run: npm run build + - name: Lint + run: cargo clippy --locked --all-targets -- -D warnings + - name: Test + run: cargo test --locked -p mesh-console --lib + + ui-quality: + name: UI format, lint, and test + runs-on: ubuntu-24.04 + timeout-minutes: 20 + defaults: + run: + working-directory: ui + steps: + - name: Check out repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 22 + cache: npm + cache-dependency-path: ui/package-lock.json + - name: Install dependencies + run: npm ci + - name: Check formatting + run: npm run format:check + - name: Lint + run: npm run lint + - name: Type check + run: npm run typecheck + - name: Install Playwright Chromium + run: npx playwright install --with-deps chromium + - name: Build + run: npm run build + - name: Run mocked end-to-end tests + run: npm run test:e2e