Skip to content

Commit

Permalink
Merge pull request #1572 from dodona-edu/fix/simplify-parsers
Browse files Browse the repository at this point in the history
Remove obsolete prepare from parsers, clarify submodule cloning
  • Loading branch information
rien authored Jun 28, 2024
2 parents 34a9560 + 752ab80 commit 7810bad
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ jobs:
- name: Build 🔧
run: |
cd parsers/
npm run prepare
npm run build
lib-lint:
Expand Down Expand Up @@ -575,7 +574,6 @@ jobs:
- name: Build parsers 🔧
run: |
cd parsers/
npm run prepare
npm run build
- name: Build lib 🔧
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,39 @@ jobs:

- name: Run test script
run: ./test_package.sh

docker-api:
name: "Build dolos-api docker container"
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Build API container
run: |
cd api
docker build .
docker-web:
name: "Build dolos-web docker container"
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Build WEB container
run: |
cd web
docker build .
docker-cli:
name: "Build dolos-cli docker container"
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Build WEB container
run: |
cd web
docker build .
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ Visit our web page at <https://dolos.ugent.be/docs>.

### Building and developing

To develop the parsers, library or CLI components, you will need to clone this repository recursively to include its submodules (the tree-sitter parsers):

```sh
git clone --recursive git://github.com/dodona-edu/dolos.git

# or, if you have cloned the repository already:
git submodule update --init --recursive
```

You only need to run install the dependencies once in the repository root by
running `npm install`. This will install all dependencies and link them in each
project's `node_modules`. You should **not** run `npm install` in each project's directory separately.
Expand Down
16 changes: 12 additions & 4 deletions parsers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,23 @@ npm install @dodona/dolos-parsers
These parsers use [tree-sitter](https://www.npmjs.com/package/tree-sitter) to parse source code files.
Tree-sitter currently only runs in node and will thus not run in browser environments.



## Development

1. Install dependencies (preferably in the repository root)
1. Clone the Dolos repository including the submodules
```sh
git clone --recursive git://github.com/dodona-edu/dolos.git

# or, if you have cloned the repository already:
git submodule update --init --recursive
```


2. Install dependencies (preferably in the repository root)
```sh
npm install
```
2. Prepare the project (generate some parsers)
```
npm run prepare
```
3. Build the node bindings
```
Expand Down
1 change: 0 additions & 1 deletion parsers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"main": "index.js",
"license": "MIT",
"scripts": {
"prepare": "(cd sql && tree-sitter generate)",
"build": "node-gyp rebuild"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ npm install

for dir in core parsers lib web cli; do
echo "=== Building and packing $dir ===="
(cd $dir && (npm run prepare || true) && npm run build && npm pack)
(cd $dir && npm run build && npm pack)
done

echo "=== Building and packing complete ===="
Expand Down

0 comments on commit 7810bad

Please sign in to comment.