Author: Michael Davis [mcarsondavis@gmail.com]
Hash: 3baeaa8a92e0c07085983ca4ffb9b3a2d635b7c2
Timestamp: Sun, 26 Dec 2021 16:42:16 +0000 (2 years ago)

+79 -0 +/-2 browse
add CI and parser generation actions workflows
1diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
2new file mode 100644
3index 0000000..0ed66f6
4--- /dev/null
5+++ b/.github/workflows/ci.yml
6 @@ -0,0 +1,37 @@
7+ name: CI
8+
9+ on: push
10+
11+ jobs:
12+ bless:
13+ name: Bless
14+ runs-on: ubuntu-latest
15+
16+ steps:
17+ - name: Checkout
18+ uses: actions/checkout@v2
19+
20+ - name: Install Node
21+ uses: actions/setup-node@v2
22+ with:
23+ node-version: "14.x"
24+
25+ - name: Cache npm dependencies
26+ uses: actions/cache@v2
27+ with:
28+ path: ~/.npm
29+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
30+ restore-keys: |
31+ ${{ runner.os }}-node-
32+
33+ - name: Install npm dependencies
34+ run: npm ci
35+
36+ - name: Ensure generated parser files are up to date
37+ run: npx tree-sitter generate
38+
39+ - name: Run tree-sitter tests
40+ run: npx tree-sitter test
41+
42+ - name: Check formatting
43+ run: npm run format-check
44 diff --git a/.github/workflows/generate-parser.yml b/.github/workflows/generate-parser.yml
45new file mode 100644
46index 0000000..ce0130a
47--- /dev/null
48+++ b/.github/workflows/generate-parser.yml
49 @@ -0,0 +1,42 @@
50+ # generates the parser with 'tree-sitter generate' if the parser is out of date
51+ name: Generate Parser
52+
53+ on:
54+ push:
55+ branches:
56+ - main
57+ jobs:
58+ generate:
59+ name: Generate Parser
60+ runs-on: ubuntu-latest
61+
62+ steps:
63+ - name: Checkout
64+ uses: actions/checkout@v2
65+
66+ - name: Install Node
67+ uses: actions/setup-node@v2
68+ with:
69+ node-version: "14.x"
70+
71+ - name: Cache npm dependencies
72+ uses: actions/cache@v2
73+ with:
74+ path: ~/.npm
75+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
76+ restore-keys: |
77+ ${{ runner.os }}-node-
78+
79+ - name: Install npm dependencies
80+ run: npm ci
81+
82+ - name: Generate parser files
83+ run: |
84+ npx tree-sitter generate
85+ npx tree-sitter build-wasm
86+
87+ - name: Commit generated parser files
88+ uses: stefanzweifel/git-auto-commit-action@v4
89+ with:
90+ commit_message: Generate parser
91+ file_pattern: src *.wasm