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

Contiuous Integration using OpenModelica/openmodelica-library-testing-action #83

Merged
merged 12 commits into from
Feb 2, 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
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*.order text eol=lf
Testing/OpenModelica/rtest text eol=lf

# Set linguist language to Modelica
*.mo linguist-language=Modelica

# Denote all files that are truly binary and should not be modified.
*.jpg binary
*.mat binary
Expand Down
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Each line is a file pattern followed by one or more owners.

# License changes
*license* @bernhardbachmann
*LICENSE* @bernhardbachmann
51 changes: 30 additions & 21 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,50 @@
name: Test

on:
workflow_dispatch:
pull_request:
push:
branches:
- 'master'
pull_request:
- main
- 'releases/*'
tags: 'v*'

jobs:
test:
runs-on: 'ubuntu-latest'
env:
OPENMODELICAHOME: '/usr'
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
omc-version: ['stable']
fail-fast: false

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

- name: "Set up OpenModelica Compiler"
uses: AnHeuermann/setup-[email protected]
- name: Setup Python 3
uses: actions/setup-python@v5
with:
version: 'stable'
python-version: '3.10'

- name: Setup OpenModelica
uses: OpenModelica/setup-openmodelica@v1
with:
version: ${{ matrix.omc-version }}
packages: |
omc
libraries: |
'Modelica 4.0.0'
Modelica 4.0.0
omc-diff: true

- name: "Test OpenModelica"
run: "make -C Testing openmodelica"

- name: "Upload openmodelica.log"
uses: actions/upload-artifact@v3
- name: openmodelica-library-testing
uses: OpenModelica/[email protected]
with:
name: openmodelica.log
path: Testing/openmodelica.log
library: PNlib
library-version: '2.2'
modelica-file: PNlib/package.mo
omc-version: ${{ matrix.omc-version }}
reference-files-dir: ReferenceFiles
reference-files-extension: mat
reference-files-delimiter: .

- name: "Look for failing tests"
run: |
grep "\(^ - \)\|\(... equation mismatch\)" Testing/openmodelica.log | true
grep -i "^== 0 out of [0-9]* tests failed" Testing/openmodelica.log
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright 2013 - 2024 Sabrina Proß, Lennart Ochel, Timo Lask, Bernhard Bachmann

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
78 changes: 53 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,67 @@
# PNlib

[![Test][test-badge]][test-link]

Free Modelica library for modelling xHPN.

## Library description
The advanced Petri Net library, called PNlib, enables the modeling of extended hybrid Petri Nets (xHPN). It comprises
* discrete (PD) and continuous places (PC),
* discrete (TD), stochastic (TS), and continuous transitions (TC), and
* test (TA), inhibitor (IA), and read arcs (RA).

![iconsxHPN](PNlib/Resources/Images/iconsxHPN.png "xHPN: Extended Hybrid Petri Nets")
The advanced Petri Net library, called PNlib, enables the modeling of extended
hybrid Petri Nets (xHPN). It comprises

* discrete (PD) and continuous places (PC),
* discrete (TD), stochastic (TS), and continuous transitions (TC), and
* test (TA), inhibitor (IA), and read arcs (RA).

![iconsxHPN][pnlib-img]

The main package PNlib is divided into the following sub-packages:
* _Interfaces_: contains the connectors of the Petri net component models.
* _Blocks_: contains blocks with specific procedures that are used in the Petri net component models.
* _Functions_: contains functions with specific algorithmic procedures which are used in the Petri net component models.
* _Constants_: contains constants which are used in the Petri net component models.
* _Examples_: contains several examples and unit tests.

* _Interfaces_: contains the connectors of the Petri net component models.
* _Blocks_: contains blocks with specific procedures that are used in the Petri
net component models.
* _Functions_: contains functions with specific algorithmic procedures which
are used in the Petri net component models.
* _Constants_: contains constants which are used in the Petri net component
models.
* _Examples_: contains several examples and unit tests.

## Current release
Download [PNlib v2.2 (2019-10-24)](../../archive/v2.2.zip)

## Compatibility [![Test](https://github.com/AMIT-HSBI/PNlib/actions/workflows/Test.yml/badge.svg)](https://github.com/AMIT-HSBI/PNlib/actions/workflows/Test.yml)
* Works in OpenModelica (latest release) ([trend](http://libraries.openmodelica.org/branches/history/master/PNlib.svg), [coverage](http://libraries.openmodelica.org/branches/master/PNlib/PNlib.html))
* Works in Dymola 2017/2019/2020
Download [PNlib v2.2 (2019-10-24)][release-v-2-2]

## Compatibility

* Works in OpenModelica (latest release)

![Pnlib omc-master](https://libraries.openmodelica.org/branches/history/master/PNlib.svg)

Latest [Coverage][coverage-link] with OpenModelica.
* Works in Dymola 2017/2019/2020

## License
This Modelica package is free software and the use is completely at your own risk;
it can be redistributed and/or modified under the terms of the [Modelica License 2](https://modelica.org/licenses/ModelicaLicense2).

This package is licensed with the [3-Clause BSD License](./LICENSE).

## Development and contribution
University of Applied Sciences Bielefeld
Department of engineering and mathematics
33619 Bielefeld - Germany
* Sabrina Proß
* Lennart Ochel
* Timo Lask
* Bernhard Bachmann

You may report feedback, issues or feature-requests using the [Issues](../../issues) button.

```
Hochschule Bielefeld – University of Applied Sciences and Arts
Faculty of Engineering and Mathematics
```

* Sabrina Proß
* Lennart Ochel
* Timo Lask
* Bernhard Bachmann

You may report feedback, issues or feature-requests using
[GitHub Issues][issues].

[test-badge]: https://github.com/AMIT-HSBI/PNlib/actions/workflows/Test.yml/badge.svg
[test-link]: https://github.com/AMIT-HSBI/PNlib/actions/workflows/Test.yml
[pnlib-img]: PNlib/Resources/Images/iconsxHPN.png "xHPN: Extended Hybrid PetriNets"
[release-v-2-2]: https://github.com/AMIT-HSBI/PNlib/releases/tag/v2.2
[coverage-link]: http://libraries.openmodelica.org/branches/master/PNlib/PNlib.html
[license-link]: https://modelica.org/licenses/ModelicaLicense2
[issues]: https://github.com/AMIT-HSBI/PNlib/issues
Binary file modified ReferenceFiles/PNlib.Examples.ExtTest.ArcswithPCtoTC3.mat
Binary file not shown.
2 changes: 1 addition & 1 deletion Testing/Dymola/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TEST = ./../OpenModelica/rtest -v
TEST = ../rtest -v
DYMOLA = Dymola

TESTFILES = \
Expand Down
11 changes: 2 additions & 9 deletions Testing/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
.PHONY : test clean openmodelica dymola
.PHONY : test clean dymola

test: openmodelica dymola

openmodelica:
@make -C OpenModelica | tee openmodelica.log
@make -C OpenModelica clean
@echo ""
@grep == openmodelica.log
test: dymola

dymola:
@make -C Dymola | tee dymola.log
Expand All @@ -15,6 +9,5 @@ dymola:
@grep == dymola.log

clean:
@make -C OpenModelica clean
@make -C Dymola clean
@rm *.log
12 changes: 0 additions & 12 deletions Testing/OpenModelica/.gitignore

This file was deleted.

138 changes: 0 additions & 138 deletions Testing/OpenModelica/Makefile

This file was deleted.

Loading