Skip to content

Commit

Permalink
ci: fail if generated files do not match and add prettier (#28)
Browse files Browse the repository at this point in the history
* ci: fail if generated files do not match

* ci: add prettier

* ci: add prettier

* chore: format grammar.js
  • Loading branch information
qvalentin authored Jan 27, 2025
1 parent ab4a8c4 commit 845c471
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 23 deletions.
49 changes: 29 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
name: Build/test
on:
push:
branches:
- "master"
pull_request:
push:
branches:
- 'master'
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install
- run: npm test
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install
- name: generate grammar
run: npm run build
- name: check for uncommited changes
run: git diff --exit-code
- run: npm test
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npx prettier --check *.js
4 changes: 2 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const make_grammar = require('./make_grammar');
const make_grammar = require('./make_grammar')

module.exports = make_grammar('gotmpl');
module.exports = make_grammar('gotmpl')
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"nan": "^2.22.0"
},
"devDependencies": {
"tree-sitter-cli": "^0.24.7"
"tree-sitter-cli": "^0.24.7",
"prettier": "^3.4.2"
},
"scripts": {
"build": "tree-sitter generate && node-gyp build && npm run build-helm",
Expand Down

0 comments on commit 845c471

Please sign in to comment.