From f3b7cd2d4b11b34ed704635a6004c9ab2b4aaa45 Mon Sep 17 00:00:00 2001 From: Rien Maertens Date: Fri, 28 Jun 2024 13:48:21 +0200 Subject: [PATCH 1/2] Remove obsolete prepare from parsers, clarify submodule cloning --- .github/workflows/ci-cd.yml | 2 -- README.md | 9 +++++++++ parsers/README.md | 16 ++++++++++++---- parsers/package.json | 1 - test_package.sh | 2 +- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 6fc2e2bbb..48d0f483e 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -322,7 +322,6 @@ jobs: - name: Build 🔧 run: | cd parsers/ - npm run prepare npm run build lib-lint: @@ -575,7 +574,6 @@ jobs: - name: Build parsers 🔧 run: | cd parsers/ - npm run prepare npm run build - name: Build lib 🔧 diff --git a/README.md b/README.md index e962ff172..b9e56c3cb 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,15 @@ Visit our web page at . ### 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. diff --git a/parsers/README.md b/parsers/README.md index 9e2305823..2639299b9 100644 --- a/parsers/README.md +++ b/parsers/README.md @@ -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 ``` diff --git a/parsers/package.json b/parsers/package.json index 6cc8ec357..7616490c0 100644 --- a/parsers/package.json +++ b/parsers/package.json @@ -5,7 +5,6 @@ "main": "index.js", "license": "MIT", "scripts": { - "prepare": "(cd sql && tree-sitter generate)", "build": "node-gyp rebuild" }, "dependencies": { diff --git a/test_package.sh b/test_package.sh index 85e4ee35a..b9c76ba03 100755 --- a/test_package.sh +++ b/test_package.sh @@ -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 ====" From 752ab80862cc6001ed87bbf451cfcf3be892e5a8 Mon Sep 17 00:00:00 2001 From: Rien Maertens Date: Fri, 28 Jun 2024 14:08:56 +0200 Subject: [PATCH 2/2] Test building containers in validation CI --- .github/workflows/validation.yml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 3c1bc457d..80712f2a9 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -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 .