From 6e4830357bb165fb25274bb484db74c208f140fa Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Thu, 26 Feb 2026 13:09:13 +0000 Subject: [PATCH] Workflow for check/testing web --- .github/workflows/web-checks.yml | 96 ++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/web-checks.yml diff --git a/.github/workflows/web-checks.yml b/.github/workflows/web-checks.yml new file mode 100644 index 0000000..0736816 --- /dev/null +++ b/.github/workflows/web-checks.yml @@ -0,0 +1,96 @@ +name: Web Checks + +on: + pull_request: + paths: ['web/**'] + workflow_dispatch: + +permissions: + contents: read + +jobs: + lint: + name: ๐Ÿงผ Lint + runs-on: ubuntu-latest + defaults: + run: + working-directory: web + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: web/.nvmrc + cache: yarn + cache-dependency-path: web/yarn.lock + - run: yarn install --frozen-lockfile + - run: yarn lint + + format: + name: ๐Ÿ’… Format + runs-on: ubuntu-latest + defaults: + run: + working-directory: web + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: web/.nvmrc + cache: yarn + cache-dependency-path: web/yarn.lock + - run: yarn install --frozen-lockfile + - run: yarn format:check + + typecheck: + name: ๐Ÿงฉ Typecheck + runs-on: ubuntu-latest + defaults: + run: + working-directory: web + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: web/.nvmrc + cache: yarn + cache-dependency-path: web/yarn.lock + - run: yarn install --frozen-lockfile + - run: yarn typecheck + + test: + name: ๐Ÿงช Test + runs-on: ubuntu-latest + defaults: + run: + working-directory: web + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: web/.nvmrc + cache: yarn + cache-dependency-path: web/yarn.lock + - run: yarn install --frozen-lockfile + - run: yarn test + + summary: + name: ๐Ÿ’ฌ Summary + if: always() + needs: [lint, format, typecheck, test] + runs-on: ubuntu-latest + steps: + - name: Build results table + run: | + em() { if [ "$1" = "success" ]; then echo "pass โœ…"; else echo "FAIL โŒ"; fi; } + line() { echo "| $1 | \`$2\` | $(em "$3") |"; } + + { + echo "## Web Checks Summary" + echo "" + echo "| Check | Command | Result |" + echo "|-------|---------|--------|" + line "Lint" "yarn lint" "${{ needs.lint.result }}" + line "Format" "yarn format:check" "${{ needs.format.result }}" + line "Typecheck" "yarn typecheck" "${{ needs.typecheck.result }}" + line "Test" "yarn test" "${{ needs.test.result }}" + } >> "$GITHUB_STEP_SUMMARY"