Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: switch to upstream actions #28

Merged
merged 3 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
name: CI

on:
push:
branches: [master]
paths:
pull_request:
branches: [master]

jobs:
build:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: tree-sitter/setup-action@v1
with:
install-lib: false
- run: npm i
- run: tree-sitter generate
- uses: tree-sitter/parser-test-action@v1.2
with:
node-version: '16'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
test-library: true
- name: Parse Petalisp
run: |
git submodule init
Expand All @@ -30,5 +34,3 @@ jobs:
else
echo "Successfully parsed Sly"
fi
- name: Run tests
run: npm test
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish package

on:
push:
tags: ["*"]

jobs:
npm:
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
crates:
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}
33 changes: 12 additions & 21 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions bindings/node/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using namespace v8;

extern "C" TSLanguage * tree_sitter_jinja2();
extern "C" TSLanguage * tree_sitter_commonlisp();

namespace {

Expand All @@ -17,12 +17,12 @@ void Init(Local<Object> exports, Local<Object> module) {

Local<Function> constructor = Nan::GetFunction(tpl).ToLocalChecked();
Local<Object> instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked();
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_jinja2());
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_commonlisp());

Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("jinja2").ToLocalChecked());
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("commonlisp").ToLocalChecked());
Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance);
}

NODE_MODULE(tree_sitter_jinja2_binding, Init)
NODE_MODULE(tree_sitter_commonlisp_binding, Init)

} // namespace
4 changes: 2 additions & 2 deletions bindings/node/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
try {
module.exports = require("../../build/Release/tree_sitter_jinja2_binding");
module.exports = require("../../build/Release/tree_sitter_commonlisp_binding");
} catch (error1) {
if (error1.code !== 'MODULE_NOT_FOUND') {
throw error1;
}
try {
module.exports = require("../../build/Debug/tree_sitter_jinja2_binding");
module.exports = require("../../build/Debug/tree_sitter_commonlisp_binding");
} catch (error2) {
if (error2.code !== 'MODULE_NOT_FOUND') {
throw error2;
Expand Down
4 changes: 2 additions & 2 deletions bindings/rust/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! This crate provides jinja2 language support for the [tree-sitter][] parsing library.
//! This crate provides commonlisp language support for the [tree-sitter][] parsing library.
//!
//! Typically, you will use the [language][language func] function to add this language to a
//! tree-sitter [Parser][], and then use the parser to parse some code:
//!
//! ```
//! let code = "";
//! let mut parser = tree_sitter::Parser::new();
//! parser.set_language(tree_sitter_commonlisp::language()).expect("Error loading jinja2 grammar");
//! parser.set_language(tree_sitter_commonlisp::language()).expect("Error loading commonlisp grammar");
//! let tree = parser.parse(code, None).unwrap();
//! ```
//!
Expand Down
42 changes: 4 additions & 38 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"author": "Stephan Seitz",
"license": "MIT",
"dependencies": {
"nan": "^2.17.0",
"tree-sitter-clojure": "git@github.com:theHamsta/tree-sitter-clojure-1.git#95c7959c461406381b42113dcf4591008c663d21"
"nan": "^2.17.0"
},
"repository": {
"type": "git",
"url": "git://github.com/theHamsta/tree-sitter-commonlisp"
},
"devDependencies": {
"tree-sitter-cli": "^0.20.8"
"tree-sitter-cli": "^0.20.8",
"tree-sitter-clojure": "git@github.com:theHamsta/tree-sitter-clojure.git#commonlisp"
}
}