diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..deb99f1 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,20 @@ +name: unit-tests +run-name: ${{ github.actor }} - unit tests +on: [push] +jobs: + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - uses: docker-practice/actions-setup-docker@master + timeout-minutes: 12 + - name: Unit tests + run: | + cd bin + bash ./build.sh + cd ../tests + pwd + bash ./run.sh \ No newline at end of file diff --git a/README.md b/README.md index 8b9a2f7..8432b31 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # What is Cloudnet TOSCA toolbox? Cloudnet TOSCA toolbox is an OASIS TOSCA processor for checking and adjusting TOSCA service templates. -TOSCA templates specify service structure and the procedure governing their life cycle. Services are typically application, infrastructure or network services. +TOSCA templates specify service structure and the procedure governing their lifecycle. Services are typically application, infrastructure or network services. This set of tools is intended for syntax and type checking of any service templates written in TOSCA, including e.g. [NFV descriptors](https://forge.etsi.org/rep/nfv/SOL001). It also allows for visualizing the associated architecture in different ways (UML, TOSCA, network diagrams). Have a look to [this video](https://www.youtube.com/watch?v=6yt-mqzbos4). A web portal based on this code is available at this url: [https://toscatoolbox.orange.com](https://toscatoolbox.orange.com). @@ -13,6 +13,8 @@ A web portal based on this code is available at this url: [https://toscatoolbox. - [Network diagrams generation](#then-to-generate-network-diagrams-type)
- [TOSCA diagrams generation](#to-get-tosca-diagrams-use-the-command)
- [UML diagrams generation](#and-to-generate-uml-diagrams)
+- [Using TOSCA script from GitHub actions](#using-toscatoolbox-in-github-actions)
+- [Code status](#status)
## Prerequisites @@ -62,7 +64,7 @@ will : - translate it into the MIT Alloy language, - generate .dot, .nwdiag and .plantuml templates. -## Then to generate network diagrams, type: +## Then to generate network diagrams, type ```sh generate_network_diagrams Results/NetworkDiagrams/*.nwdiag @@ -70,7 +72,7 @@ generate_network_diagrams Results/NetworkDiagrams/*.nwdiag ![Network diagram example](/docs/pictures/OASIS-TOSCA-1.3_example-8.6.1_nw.png) -## To get TOSCA diagrams, use the command: +## To get TOSCA diagrams, use the command ```sh generate_tosca_diagrams Results/ToscaDiagrams/*.dot @@ -78,10 +80,19 @@ generate_tosca_diagrams Results/ToscaDiagrams/*.dot ![TOSCA diagram example](/docs/pictures/OASIS-TOSCA-1.3_example-8.6.1_tosca.png) -## And to generate UML diagrams: +## And to generate UML diagrams ```sh generate_uml2_diagrams Results/Uml2Diagrams/*.plantuml ``` ![UML diagram example](/docs/pictures/OASIS-TOSCA-1.3_example-8.6.1_uml2.png) + +## Using ToscaToolBox in GitHub actions + +This GitHub project [actionTOSCAToolbox](https://github.com/JLCoulin/actionTOSCAToolbox) demonstrate how to launch a TSOSCA syntax checking from the actions. + +## Status + +[![unit-tests](https://github.com/JLCoulin/Cloudnet-TOSCA-toolbox/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/JLCoulin/Cloudnet-TOSCA-toolbox/actions/workflows/unit-tests.yml) +[![Lint Code Base](https://github.com/JLCoulin/Cloudnet-TOSCA-toolbox/actions/workflows/linter.yml/badge.svg)](https://github.com/JLCoulin/Cloudnet-TOSCA-toolbox/actions/workflows/linter.yml) \ No newline at end of file diff --git a/examples/OpenStack/tosca2cloudnet.yaml b/examples/OpenStack/tosca2cloudnet.yaml index d101cf9..29c0deb 100644 --- a/examples/OpenStack/tosca2cloudnet.yaml +++ b/examples/OpenStack/tosca2cloudnet.yaml @@ -17,30 +17,36 @@ Alloy: # Target directory where Alloy files are generated. target-directory: RESULTS/Alloy + generation: true # Configuration of the declarative workflow generator. DeclarativeWorkflows: # Target directory where declarative workflows are generated. target-directory: RESULTS/DeclarativeWorkflows + generation: false # Configuration of the network diagram generator. nwdiag: # Target directory where network diagrams are generated. target-directory: RESULTS/NetworkDiagrams + generation: true # Configuration of the TOSCA diagram generator. tosca_diagrams: # Target directory where network diagrams are generated. target-directory: RESULTS/ToscaDiagrams + generation: true # Configuration of the UML2 diagram generator. UML2: # Target directory where UML2 diagrams are generated. target-directory: RESULTS/Uml2Diagrams + generation: true HOT: # Target directory where HOT templates are generated. target-directory: RESULTS/HOT + generation: true # Logging configuration. logging: