Repository navigation
82 lines (77 loc) · 2.95 KB
/
Copy pathci.yml
File metadata and controls
82 lines (77 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
on:
push:
branches: [main, next-gen]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check:
name: Lint, typecheck, test, build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm format:check
- run: pnpm typecheck
- name: Unit tests with coverage
run: pnpm test:coverage
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
files: coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- run: pnpm build
- name: Script tag build
run: pnpm test:browser-build
- name: Examples
run: pnpm examples:build
git-install:
name: Install from Git (store under node_modules)
# Apps install `github:Javaabu/react-forms#next-gen`, so pnpm builds the package (`prepare`) in a temp
# folder inside its store. On GitHub Actions that store is under `node_modules`, which once broke
# declaration emit (TS2883, #20). Install this commit the same way, into a fresh app.
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
with:
node-version: 22
# This job installs into its own store, so there's nothing to cache. With the cache on, setup-node
# fails its post step when no earlier cache was restored, because the default store doesn't exist.
package-manager-cache: false
- name: Install @javaabu/forms from Git into a new app
env:
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
app="$RUNNER_TEMP/app"
mkdir -p "$app" && cd "$app"
cat > package.json <<JSON
{
"name": "git-install-check",
"private": true,
"type": "module",
"dependencies": {
"@javaabu/forms": "github:${{ github.repository }}#$SHA",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"pnpm": { "onlyBuiltDependencies": ["@javaabu/forms", "@javaabu/i18n"] }
}
JSON
pnpm install --store-dir "$RUNNER_TEMP/store/node_modules/.pnpm-store"
test -f node_modules/@javaabu/forms/dist/index.d.ts
node -e 'const f = require("@javaabu/forms"); if (typeof f.Form !== "function") process.exit(1)'
node --input-type=module -e 'import { Form } from "@javaabu/forms"; import { html } from "@javaabu/forms/html"; if (typeof Form !== "function" || html.name !== "html") process.exit(1)'