Skip to content

Commit 8fbb704

Browse files
committed
ci(.github): add build.yml; defer linting for now
Signed-off-by: Vaughn Dice <[email protected]>
1 parent e648d27 commit 8fbb704

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

.github/workflows/build.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
branches: [main]
5+
6+
env:
7+
BART_VERSION: v0.10.0
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Node
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
20+
- name: Setup Spin
21+
uses: fermyon/actions/spin/setup@v1
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Install bart
26+
run: |
27+
curl -LOs https://github.com/fermyon/bartholomew/releases/download/${{ env.BART_VERSION }}/bart-${{ env.BART_VERSION }}-linux-amd64.tar.gz
28+
tar zxvf bart-${{ env.BART_VERSION }}-linux-amd64.tar.gz
29+
mv bart /usr/local/bin
30+
- name: Check Docs
31+
run: |
32+
bart check --shortcodes shortcodes content/* && bart check --shortcodes shortcodes content/**/*
33+
34+
- name: Install npm packages
35+
run: |
36+
npm ci
37+
npm ci --prefix ./spin-up-hub
38+
39+
- name: Build app
40+
run: |
41+
spin build
42+
43+
# TODO: re-enable after figuring out how to confgure the current linting tool; or choose another.
44+
# By default, the current tool appears very aggressive, presenting errors for eg
45+
# multiple consecutive new-lines, non-conforming title capitalization, etc
46+
#
47+
# - name: Lint markdown
48+
# run: |
49+
# npm run lint-markdown
50+
51+
- name: Run npm tests
52+
run: |
53+
npm test

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"spin": "nodemon --watch content --watch static --watch templates --watch spin-up-hub --ext html,md,rhai,hbs,css,js --verbose --legacy-watch --signal SIGINT --exec 'npm run build-index && npm run build-hub-index && spin up --file spin.toml --quiet --env PREVIEW_MODE=$PREVIEW_MODE'",
4141
"bundle-scripts": "parcel watch static/js/src/main.js --dist-dir static/js --no-source-maps",
4242
"styles": "parcel watch static/sass/styles.scss --dist-dir static/css",
43-
"test": "npx markdownlint-cli2 content/**/*.md \"#node_modules\" && npm run check-broken-links",
43+
"lint-markdown": "npx markdownlint-cli2 content/**/*.md \"#node_modules\"",
44+
"test": "npm run check-broken-links",
4445
"build-index": "node md_parser.mjs --dir=./content/ --out=./static/data.json --ignore=./content/api/**/*",
4546
"check-broken-links": ".build/check-broken-links.sh",
4647
"build-hub-index": "node hub_index_generator.mjs --dir=./content/api/hub/ --out=./static/hub-index-data.json --ignore=./content/api/hub/get_list.md,"

0 commit comments

Comments
 (0)