Skip to content

Commit 66e444b

Browse files
authored
Add GitHub workflow (#9)
1 parent c877278 commit 66e444b

File tree

4 files changed

+178
-0
lines changed

4 files changed

+178
-0
lines changed

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
env:
10+
CI: true
11+
12+
jobs:
13+
test-examples:
14+
runs-on: ubuntu-latest
15+
name: "Test build of example projects"
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2.3.5
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v2.4.1
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v2.0.1
23+
with:
24+
version: 6.x.x
25+
26+
- name: Install
27+
run: pnpm i
28+
29+
- name: Test
30+
run: node ./build-examples.mjs

build-examples.mjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { readdirSync, readFileSync, existsSync } from 'fs'
2+
import { execa } from 'execa'
3+
4+
const id = Math.random().toString(36).substr(2, 9)
5+
6+
const examples = readdirSync('./')
7+
.filter((f) => existsSync(`./${f}/package.json`))
8+
.map((f) => ({
9+
folder: `./${f}`,
10+
package: JSON.parse(readFileSync(`./${f}/package.json`).toString()),
11+
}))
12+
13+
async function buildExamples () {
14+
for (const example of examples) {
15+
console.log(`building ${example.folder}...`)
16+
await execa('pnpm', ['i'], { stdio: 'inherit', cwd: example.folder })
17+
await execa('pnpm', ['build'], { stdio: 'inherit', cwd: example.folder })
18+
}
19+
20+
for (const typescriptExample of examples.filter((ex) => ex.package.scripts.typecheck != null)) {
21+
console.log(`typechecking ${typescriptExample.folder}...`)
22+
await execa('pnpm', ['typecheck'], { stdio: 'inherit', cwd: typescriptExample.folder })
23+
}
24+
}
25+
26+
await buildExamples()

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "examples",
3+
"version": "1.0.0",
4+
"description": "fluent-vue examples",
5+
"devDependencies": {
6+
"execa": "^6.0.0"
7+
}
8+
}

pnpm-lock.yaml

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy