mirror of
https://github.com/Lissy93/awesome-privacy.git
synced 2026-03-11 08:55:33 +00:00
Workflow for check/testing web
This commit is contained in:
parent
8df08fcddf
commit
6e4830357b
1 changed files with 96 additions and 0 deletions
96
.github/workflows/web-checks.yml
vendored
Normal file
96
.github/workflows/web-checks.yml
vendored
Normal file
|
|
@ -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"
|
||||
Loading…
Reference in a new issue