mirror of
https://github.com/Lissy93/awesome-privacy.git
synced 2026-03-11 08:55:33 +00:00
96 lines
2.5 KiB
YAML
96 lines
2.5 KiB
YAML
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"
|