Skip to content

Commit

Permalink
Merge branch 'INTO-CPS-Association:feature/distributed-demo' into fea…
Browse files Browse the repository at this point in the history
…ture/distributed-demo
  • Loading branch information
astitva1905 authored Sep 27, 2023
2 parents 5809a6b + 6e6b9f5 commit 636b362
Show file tree
Hide file tree
Showing 40 changed files with 7,821 additions and 144 deletions.
14 changes: 13 additions & 1 deletion .git-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
#!/usr/bin/env sh

TOP_DIR="$(pwd)"
export TOP_DIR

if git diff --cached --name-only | grep "^client/" >/dev/null; then
cd client || exit
yarn install
yarn format && yarn syntax
else
printf "No changes in the client directory. Skipping pre-commit hook."
printf "No changes in the client directory. Skipping pre-commit hook.\n\n"
fi

cd "$TOP_DIR" || exit
if git diff --cached --name-only | grep "^servers/execution/runner/" >/dev/null; then
cd "servers/execution/runner" || exit
yarn install
yarn format && yarn syntax
else
printf "No changes in the servers/execution/runner directory. Skipping pre-commit hook.\n\n"
fi
13 changes: 12 additions & 1 deletion .git-hooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
#!/usr/bin/env sh

BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
TOP_DIR="$(pwd)"
export TOP_DIR

if git diff --name-only origin/"$BRANCH_NAME"...HEAD | grep "^client/" >/dev/null; then
cd client || exit
yarn install
yarn jest . --coverage=false
else
echo "No changes in the client directory. Skipping pre-push hook."
printf "No changes in the client directory. Skipping pre-push hook.\n\n"
fi

cd "$TOP_DIR" || exit
if git diff --name-only origin/"$BRANCH_NAME"...HEAD | grep "^servers/execution/runner/" >/dev/null; then
cd "servers/execution/runner" || exit
yarn install
yarn test:nocov
else
printf "No changes in the servers/execution/runner/ directory. Skipping pre-push hook.\n\n"
fi
54 changes: 54 additions & 0 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Digital twin runner

on:
push:
paths:
- 'servers/execution/**'
pull_request:
paths:
- 'servers/execution/**'
workflow_dispatch:
paths:
- 'servers/execution/**'

jobs:
test-runner:
name: Test digital twin runner
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"
cache-dependency-path: "**/yarn.lock"

- name: Run linting checks on runner
run: |
cd servers/execution/runner
yarn install
yarn syntax
- name: Build the runner
if: success() || failure()
run: |
cd servers/execution/runner
yarn install
yarn build
- name: Run tests
if: success() || failure()
run: |
cd servers/execution/runner
yarn install
yarn test
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: servers/execution/runner/coverage/clover.xml
flags: dt-runner
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# NPM registry configuration
.yarnrc
.npmrc

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

Expand Down Expand Up @@ -139,6 +143,7 @@ site/
*.sublime-workspace

# IDE - VSCode
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
Expand Down
2 changes: 1 addition & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
playwright/.auth/
playwright/.auth/
40 changes: 33 additions & 7 deletions docs/PUBLISH.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@

# Project Documentation

This file contains instructions for creation, compilation and publication of project documentation.
This file contains instructions for creation, compilation and publication of
project documentation.

The documentation system is based on [Material for Mkdocs](https://squidfunk.github.io/mkdocs-material/). The documentation is generated based on the configuration files:
The documentation system is based on
[Material for Mkdocs](https://squidfunk.github.io/mkdocs-material/).
The documentation is generated based on the configuration files:

* **mkdocs.yml**: used for generating online documentation which is hosted on the web
* **mkdocs_offline.yml**: used for generating offline documentation that can be downloaded and used on user computer.
* **mkdocs-github.yml**: used for generating documentation in github actions

Install Mkdocs using the following command.

Expand All @@ -16,24 +19,47 @@ pip install -r docs/requirements.txt

## Create documentation

You can add, and edit the markdown files in `docs/` directory to update the documentation. There is a facility to check the status of your documentation by using:
The document generation pipeline can generate both **html** and **pdf**
versions of documentation.

The generation of **pdf** version of documentation is controlled via
a shell variable.

```bash
export MKDOCS_ENABLE_PDF_EXPORT=0 #disables generation of pdf document
export MKDOCS_ENABLE_PDF_EXPORT=1 #enables generation of pdf document
```

The `mkdocs` utility allows for live editing of documentation
on the developer computer.

You can add, and edit the markdown files in `docs/` directory to update
the documentation. There is a facility to check the status of your
documentation by using:

```bash
mkdocs serve --config-file mkdocs.yml
```

## Publish documentation

You can compile and place the html version of documentation on the `webpage-docs` branch of the codebase.
You can compile and place the html version of documentation on
the `webpage-docs` branch of the codebase.

```bash
export MKDOCS_ENABLE_PDF_EXPORT=1 #enable generation of pdf document
source script/docs.sh [version]
```

The command takes an optional version parameter. This version parameter is needed for making a release. Otherwise, the documentation gets published with the latest version tag. This command makes a new commit on `webpage-docs` branch. You need to push the branch to upstream.
The command takes an optional version parameter. This version parameter is needed
for making a release. Otherwise, the documentation gets published with
the latest version tag. This command makes a new commit on `webpage-docs` branch.
You need to push the branch to upstream.

```bash
git push webpage-docs
```

The github pages system serves the [project documentation](https://into-cps-association.github.io/DTaaS/) from this branch.
The github pages system serves the
[project documentation](https://into-cps-association.github.io/DTaaS/) from
this branch.
Loading

0 comments on commit 636b362

Please sign in to comment.