Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Apr 12, 2024
1 parent b4913c2 commit b8e9017
Show file tree
Hide file tree
Showing 5 changed files with 405 additions and 377 deletions.
41 changes: 15 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,28 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Set up the repo
uses: tree-sitter/parser-setup-action@v1.2
with:
node-version: ${{vars.NODE_VERSION}}
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v1
- name: Set up examples
shell: sh
run: |-
git clone https://github.com/Bash-it/bash-it examples/bash-it -q --single-branch --depth=1
git clone https://git.savannah.gnu.org/git/bash.git examples/bash -q --single-branch --depth=1
git clone https://anongit.gentoo.org/git/repo/gentoo.git examples/gentoo -q --single-branch --depth=1
if [[ '${{runner.os}}' != Windows ]]; then
if [[ $RUNNER_OS != Windows ]]; then
git clone https://github.com/oilshell/wild-corpus examples/wild-corpus -q --single-branch --depth=1
else
sed -i script/example-files.txt -e '/wild-corpus/d'
sed -i script/known-failures.txt -e '/wild-corpus/d'
fi
- name: Read known failures
uses: actions/github-script@v7
id: known-failures
with:
result-encoding: string
script: "return require('fs').readFileSync('script/known-failures.txt', 'utf8')"
- name: Run tests
uses: tree-sitter/parser-test-action@v1.2
uses: tree-sitter/parser-test-action@v2
with:
test-rust: ${{runner.os == 'Linux'}}
- name: Parse examples
uses: tree-sitter/parse-action@v4
with:
lint: ${{runner.os == 'Linux'}}
test-library: ${{runner.os == 'Linux'}}
corpus-files: |
examples/*.sh
examples/bash-it/**/*.sh
examples/bash-it/**/*.bash
examples/bash/**/*.sh
examples/bash/**/*.tests
examples/gentoo/**/*.sh
examples/gentoo/**/*.eclass
examples/wild-corpus/**/*.sh
# examples/gentoo/**/*.ebuild
!examples/gentoo/eclass/ruby-fakegem.eclass
${{steps.known-failures.outputs.result}}
files-list: script/example-files.txt
invalid-files-list: script/known-failures.txt
16 changes: 12 additions & 4 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Fuzz Parser
name: Fuzz

on:
push:
Expand All @@ -9,10 +9,18 @@ on:
- src/scanner.c
workflow_dispatch:

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
test:
name: Parser fuzzing
name: Fuzz scanner
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tree-sitter/fuzz-action@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Run fuzzer
uses: tree-sitter/fuzz-action@v4
with:
corpus: examples
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on:
push:
branches: [master]
paths:
- grammar.js
pull_request:
paths:
- grammar.js

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{vars.NODE_VERSION}}
- name: Install modules
run: npm ci --legacy-peer-deps
- name: Run ESLint
run: npm run lint
Loading

0 comments on commit b8e9017

Please sign in to comment.