-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 40ef464
Showing
66 changed files
with
21,226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and the capellambse contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
rules: | ||
body-leading-blank: [2, always] | ||
footer-leading-blank: [2, always] | ||
scope-case: [2, always, lower-case] | ||
subject-case: [2, always, sentence-case] | ||
subject-empty: [2, never] | ||
subject-full-stop: [2, never, .] | ||
subject-max-length: [2, always, 72] | ||
type-empty: [2, never] | ||
type-enum: [2, always, [ | ||
build, | ||
chore, | ||
ci, | ||
docs, | ||
feat, | ||
fix, | ||
merge, | ||
perf, | ||
refactor, | ||
revert, | ||
test, | ||
]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright DB InfraGO AG and contributors | ||
SPDX-License-Identifier: CC0-1.0 | ||
|
||
node: $Format:%H$ | ||
node-date: $Format:%cI$ | ||
describe-name: $Format:%(describe:tags=true)$ | ||
ref-names: $Format:%D$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
* text=auto | ||
|
||
*.{cmd,[cC][mM][dD]} text eol=crlf | ||
*.{bat,[bB][aA][tT]} text eol=crlf | ||
|
||
*.{sh,py} text eol=lf | ||
|
||
.git_archival.txt export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
name: Build | ||
|
||
on: | ||
push: | ||
branches: ["*"] | ||
pull_request: [master] | ||
tags: ["v*.*.*"] | ||
|
||
jobs: | ||
test: | ||
name: Test with Python ${{matrix.python_version}} on ${{matrix.os}} | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python_version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
include: | ||
- os: windows-latest | ||
python_version: "3.10" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{matrix.python_version}} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{matrix.python_version}} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{runner.os}}-pip-${{hashFiles('pyproject.toml')}} | ||
restore-keys: | | ||
${{runner.os}}-pip- | ||
${{runner.os}}- | ||
- name: Upgrade Pip | ||
run: |- | ||
python -m pip install -U pip | ||
- name: Install test dependencies | ||
run: |- | ||
python -m pip install '.[test]' | ||
- name: Run unit tests | ||
run: |- | ||
python -m pytest --cov-report=term --cov=capella_ros_tools --rootdir=. | ||
publish: | ||
name: Publish artifacts | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: |- | ||
python -m pip install -U pip | ||
python -m pip install build twine | ||
- name: Build packages | ||
run: |- | ||
python -m build | ||
- name: Verify packages | ||
run: |- | ||
python -m twine check dist/* | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Artifacts | ||
path: 'dist/*' | ||
- name: Publish to PyPI (release only) | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: python -m twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} --non-interactive dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
name: Docs | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
|
||
jobs: | ||
sphinx: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
- name: Upgrade pip | ||
run: | | ||
python -m pip install -U pip | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install '.[docs]' | ||
- name: Auto-generate APIDOC sources | ||
run: |- | ||
sphinx-apidoc --output-dir docs/source/code --force . | ||
- name: Create docs | ||
run: | | ||
make -C docs html | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
force_orphan: true | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/build/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: ["*"] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
- name: Upgrade pip | ||
run: |- | ||
python -m pip install -U pip | ||
- name: Install pre-commit | ||
run: |- | ||
python -m pip install pre-commit types-docutils | ||
- name: Run Pre-Commit | ||
run: |- | ||
pre-commit run --all-files | ||
pylint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
- name: Upgrade pip | ||
run: |- | ||
python -m pip install -U pip | ||
- name: Install pylint | ||
run: |- | ||
python -m pip install pylint | ||
- name: Run pylint | ||
run: |- | ||
pylint -dfixme capella_ros_tools || exit $(($? & ~24)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and the capellambse contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
name: Conventional Commits | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, synchronize] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
conventional-commits: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the base branch | ||
# Commitlint will use the configuration that is checked out; i.e. in | ||
# this case it will use the config from the PR's base branch, which | ||
# must have already been approved by someone with repo write access. | ||
# | ||
# Because commitlint accepts arbitrary JavaScript as configuration, | ||
# this is necessary to prevent code injection attacks. Combined with | ||
# the `pull-requests: write` permission needed for posting comments, | ||
# this could potentially allow an attacker to merge any code into any | ||
# branch. | ||
# | ||
# However, it also means that (good) pull requests intended to change | ||
# or extend the config will be validated against the old config, which | ||
# may cause false errors. | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.base.ref }} | ||
|
||
- name: Pull the PR | ||
run: git fetch origin +${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Install commitlint | ||
run: npm install -g @commitlint/cli | ||
|
||
- name: Validate commit messages | ||
id: conventional-commits | ||
continue-on-error: true | ||
env: | ||
SHA_FROM: ${{ github.event.pull_request.base.sha }} | ||
SHA_TO: ${{ github.event.pull_request.head.sha }} | ||
run: | | ||
delim="_EOF_$(uuidgen)" | ||
echo "validation-result<<$delim" >> "$GITHUB_OUTPUT" | ||
r=0 | ||
commitlint --from "$SHA_FROM" --to "$SHA_TO" >> "$GITHUB_OUTPUT" 2>&1 || r=$? | ||
echo "$delim" >> "$GITHUB_OUTPUT" | ||
exit $r | ||
- name: Post comment if validation failed | ||
if: steps.conventional-commits.outcome == "failure" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
TEXT: |- | ||
The pull request does not conform to the conventional commit specification. Please ensure that your commit messages follow the spec: | ||
<https://www.conventionalcommits.org/> | ||
We also strongly recommend that you set up your development environment with pre-commit, as described in our [CONTRIBUTING guidelines](https://github.com/DSD-DBS/py-capellambse/blob/master/CONTRIBUTING.rst). This will run all the important checks right before you commit your changes, and avoids lengthy CI wait time and round trips. | ||
The following commits failed to validate: | ||
``` | ||
${{ steps.conventional-commits.outputs.validation-result }} | ||
``` | ||
Here are some examples of valid commit messages: | ||
``` | ||
feat(model): Add realized_states to State and Mode | ||
fix(aird): Fix ZeroDivisionError with zero-sized circles | ||
docs(readme): Update project description | ||
``` | ||
run: 'gh pr comment "$PR_NUMBER" -F - <<< "$TEXT"' |
Oops, something went wrong.