-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
117 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,40 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- '**' | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Run validation tests | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run tree-sitter tests | ||
run: npm test | ||
|
||
- name: Ensure generated parser files are up-to-date | ||
# On Windows, tree-sitter generate results in a diff, not sure why | ||
if: runner.os != 'Windows' | ||
run: | | ||
git status | ||
test -z "$(git status --porcelain)" | ||
test: | ||
name: Run validation tests | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run tree-sitter tests | ||
run: npm test | ||
- name: Ensure generated parser files are up-to-date | ||
# On Windows, tree-sitter generate results in a diff, not sure why | ||
if: runner.os != 'Windows' | ||
run: | | ||
git status | ||
test -z "$(git status --porcelain)" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Publish | ||
on: | ||
release: | ||
types: [released] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
bump: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Update npm version | ||
run: npm version ${GITHUB_REF_NAME#v} --no-git-tag-version | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- name: Install cargo bump | ||
run: cargo install cargo-bump | ||
- name: Update cargo version | ||
run: cargo bump ${GITHUB_REF_NAME#v} | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 'chore: bump version' | ||
branch: main | ||
|
||
publish_npm: | ||
runs-on: ubuntu-latest | ||
needs: bump | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install dependencies and build 🔧 | ||
run: npm ci && npm run build | ||
- name: Publish package on NPM 📦 | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_GBPROD_GITCOMMIT }} | ||
|
||
publish_crates: | ||
runs-on: ubuntu-latest | ||
needs: bump | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: cargo publish --token ${CRATES_TOKEN} | ||
env: | ||
CRATES_TOKEN: ${{ secrets.CRATES_GBPROD_GITCOMMIT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"jsxBracketSameLine": true, | ||
"printWidth": 120, | ||
"arrowParens": "always", | ||
"tabWidth": 2 | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"jsxBracketSameLine": true, | ||
"printWidth": 80, | ||
"arrowParens": "always", | ||
"tabWidth": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters