Skip to content

Commit dace1e2

Browse files
authored
Use local bikeshed instead of API service (#1516)
This allows the spec to be built locally even without internet access and provides better log output.
1 parent d654bd2 commit dace1e2

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v3
22+
- uses: actions/setup-python@v5
2223
- name: Build
2324
run: make
2425
- name: Deploy

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
out
1+
/out
2+
/venv

Makefile

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ OUT_DIR ?= out
55

66
all: $(OUT_DIR)/index.html validator
77

8-
$(OUT_DIR)/index.html: index.bs $(OUT_DIR)
9-
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
10-
--output $@ \
11-
--write-out '%{http_code}' \
12-
--header 'Accept: text/plain, text/html' \
13-
-F die-on=warning \
14-
-F file=@$<) && \
15-
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
16-
echo ""; cat $@; echo ""; \
17-
rm $@; \
18-
exit 22 \
19-
);
8+
venv-marker := venv/.make
9+
bikeshed := venv/bin/bikeshed
10+
venv: $(venv-marker)
11+
12+
$(venv-marker): Makefile
13+
python3 -m venv venv
14+
@touch $@
15+
16+
$(bikeshed): $(venv-marker) Makefile
17+
venv/bin/pip install $(notdir $@)
18+
@touch $@
19+
20+
$(OUT_DIR)/index.html: index.bs $(OUT_DIR) $(bikeshed)
21+
$(bikeshed) --die-on=warning spec $< $@
2022

2123
validator: $(OUT_DIR)/validate-headers.html $(OUT_DIR)/validate-headers.js $(OUT_DIR)/filters.html $(OUT_DIR)/filters-main.js
2224

@@ -34,7 +36,7 @@ ts/dist/header-validator/index.js ts/dist/header-validator/filters-main.js: ts/p
3436
@ npm run pack --prefix ./ts
3537

3638
clean:
37-
@ rm -rf $(OUT_DIR)
39+
@ rm -rf $(OUT_DIR) venv
3840

3941
$(OUT_DIR)/filters.html: ts/src/header-validator/filters.html $(OUT_DIR)
4042
@ cp $< $@

0 commit comments

Comments
 (0)