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

feat: technical review #11

Merged
merged 38 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
839044c
fix: general file changes
Revathyvenugopal162 Feb 20, 2024
a3f07ff
fix: ci-cd
Revathyvenugopal162 Feb 20, 2024
c068344
doc: update the docs check
Revathyvenugopal162 Feb 20, 2024
0c0a364
doc: update the test requirement
Revathyvenugopal162 Feb 20, 2024
43bdb38
debug: test requirement
Revathyvenugopal162 Feb 21, 2024
c2e900b
fix: revert ci-cd
Revathyvenugopal162 Feb 21, 2024
5a6a490
fix: checkout the lib
Revathyvenugopal162 Feb 21, 2024
2dd4ee4
fix: requirements from pyproject
Revathyvenugopal162 Feb 21, 2024
1cca9a6
fix: vale warning
Revathyvenugopal162 Feb 21, 2024
21d7e2d
fix: test docs deploy
Revathyvenugopal162 Feb 21, 2024
63cd016
fix: revert test docs deploy
Revathyvenugopal162 Feb 21, 2024
e45a486
docs:change readme target
Revathyvenugopal162 Feb 21, 2024
3949bd9
fix: test docs deploy
Revathyvenugopal162 Feb 21, 2024
f2f64de
Update .github/workflows/ci_cd.yml
Revathyvenugopal162 Feb 21, 2024
c761529
fix: spacing
Revathyvenugopal162 Feb 21, 2024
3b63725
fix: combine the requirement action
Revathyvenugopal162 Feb 21, 2024
52649c1
doc: improve action description
jorgepiloto Feb 22, 2024
7bbd57e
ci: fix link for labels
jorgepiloto Feb 22, 2024
0215c76
ci: add release step
jorgepiloto Feb 22, 2024
61c6061
fix: actions indentation
jorgepiloto Feb 22, 2024
bec8b74
fix: warnings as errors for sphinx build
jorgepiloto Feb 22, 2024
080ffd4
maint: include dependabot.yml
jorgepiloto Feb 22, 2024
9a0bb22
ci: add release.yml workflow
jorgepiloto Feb 22, 2024
34d2bb4
ci: add CODEOWNERS file
jorgepiloto Feb 22, 2024
2743137
doc: fix link
jorgepiloto Feb 22, 2024
e37f4ac
fix: code style
jorgepiloto Feb 22, 2024
511a8dd
doc: remove badges from index.rst in docs
jorgepiloto Feb 22, 2024
c4c894e
maint: update requirements/
jorgepiloto Feb 22, 2024
2d9f099
doc: add font-awesome from cdnjs
jorgepiloto Feb 22, 2024
ec1bd22
fix: header underline
jorgepiloto Feb 22, 2024
7b1b353
fix: update the sd icon
Revathyvenugopal162 Feb 22, 2024
56146d1
fix: update the fw icon dependencies
Revathyvenugopal162 Feb 22, 2024
9f830a8
fix: update the makfile
Revathyvenugopal162 Feb 22, 2024
f75169e
fix: remove unwanted function
Revathyvenugopal162 Feb 27, 2024
3960c87
fix: remove and dd required spaces and indentation in actions
Revathyvenugopal162 Feb 27, 2024
f43fcbd
fix: updat gitignore and licence
Revathyvenugopal162 Feb 27, 2024
adad4a9
fix: update the dependencies
Revathyvenugopal162 Feb 27, 2024
a3dc8bf
fix: add licence headers
Revathyvenugopal162 Feb 27, 2024
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
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These owners will be the default owners for everything in the repo. Unless a
# later match takes precedence, the PyAnsys Core team will be requested for
# review when someone opens a pull request.
* @ansys/scade-experts
ansjhenry marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/requirements"
schedule:
interval: "daily"
commit-message:
prefix: "build"
labels:
- "maintenance"
- "dependencies"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "build"
labels:
- "maintenance"
6 changes: 6 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
maintenance:
- any-glob-to-any-file: ['.github/**/*', '.pre-commit-config.yaml', 'VERSION']
testing:
- any-glob-to-any-file: ['tests/**/*']
documentation:
- any-glob-to-any-file: ['doc/**/*']
dependencies:
- any-glob-to-any-file: ['requirements/**/*']
4 changes: 4 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@
- name: release
description: Anything related to an incoming release
color: ffffff

- name: testing
description: Anything related to tests
color: BFE4D6
93 changes: 76 additions & 17 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,25 @@ jobs:
issue-number: ${{ github.event.pull_request.number }}
body: |
Please add one of the following labels to add this contribution to the Release Notes :point_down:
- [bug](https://github.com/ansys/actions/pulls?q=label%3Abug+)
- [documentation](https://github.com/ansys/actions/pulls?q=label%3Adocumentation+)
- [enhancement](https://github.com/ansys/actions/pulls?q=label%3Aenhancement+)
- [good first issue](https://github.com/ansys/actions/pulls?q=label%3Agood+first+issue)
- [maintenance](https://github.com/ansys/actions/pulls?q=label%3Amaintenance+)
- [release](https://github.com/ansys/actions/pulls?q=label%3Arelease+)
- [bug](https://github.com/ansys/scade-actions/pulls?q=label%3Abug+)
- [documentation](https://github.com/ansys/scade-actions/pulls?q=label%3Adocumentation+)
- [enhancement](https://github.com/ansys/scade-actions/pulls?q=label%3Aenhancement+)
- [good first issue](https://github.com/ansys/scade-actions/pulls?q=label%3Agood+first+issue)
- [maintenance](https://github.com/ansys/scade-actions/pulls?q=label%3Amaintenance+)
- [release](https://github.com/ansys/scade-actions/pulls?q=label%3Arelease+)

commit-and-branch-style:
name: "Commit and branch style"
runs-on: ubuntu-latest
needs: labeler
steps:

- uses: ansys/actions/commit-style@main
- name: "Check commit style"
uses: ansys/actions/commit-style@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: ansys/actions/branch-name-style@main
- name: "Check branch naming convention"
uses: ansys/actions/branch-name-style@v5

code-style:
name: "Code style"
Expand Down Expand Up @@ -131,34 +132,92 @@ jobs:
skip-install: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false
dependencies: "texlive-fonts-extra qpdf"

tests:
name: "Tests"
runs-on: [self-hosted, 'SCADE']
strategy:
matrix:
# scade-version: ['23.1', '23.2']
scade-version: ['23.2']
fail-fast: false
steps:
# - name: Checkout
# uses: actions/checkout@v4
#
- name: Execute tests
- name: "Execute setup.py tests"
uses: ./scade-tests-pytest
with:
scade-version: ${{ matrix.scade-version }}
library-dir: "tests/python-setup"
pytest-postargs: "tests/python-setup/tests -vv"
checkout: false
- name: "Execute pyproject tests"
uses: ./scade-tests-pytest
with:
scade-version: ${{ matrix.scade-version }}
library-dir: "tests/python"
pytest-postargs: "tests/python/tests -vv"
library-dir: "tests/python-pyproject"
pytest-postargs: "tests/python-pyproject/tests -vv"
checkout: false

doc-deploy-dev:
name: "Deploy developers documentation"
needs: [doc-build, tests]
runs-on: ubuntu-latest
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags')
needs: [doc-build, tests]
steps:
- uses: ansys/actions/doc-deploy-dev@v5
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}

release:
name: "Release to GitHub"
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [doc-build, tests]
steps:

- name: "Download HTML documentation"
uses: actions/download-artifact@v4
with:
name: documentation-html
path: documentation-html

- name: "Zip HTML documentation"
uses: vimtor/[email protected]
with:
files: documentation-html
dest: documentation-html.zip

- name: "Download PDF documentation"
uses: actions/download-artifact@v4
with:
name: documentation-pdf
path: documentation-pdf

- name: "Zip PDF documentation"
uses: vimtor/[email protected]
with:
files: documentation-pdf
dest: documentation-pdf.zip

- name: "Display the structure of downloaded files"
shell: bash
run: ls -R

- name: "Release to GitHub"
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
documentation-html.zip
documentation-pdf.zip

doc-deploy-stable:
name: "Upload stable documentation"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: release
steps:
- uses: ansys/actions/doc-deploy-stable@v5
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Rolling release
on:
push:
tags:
- "v*.*.*"

permissions: write-all

jobs:
automate-tagging:
name: "Perform rolling release"
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Configure git"
run: |
git config user.name github-actions
git config user.email [email protected]

- name: "Decompose tag into components"
run: |
if [[ ${{ github.ref_name }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# Split the tag into its components
IFS='.' read -ra PARTS <<< "${{ github.ref_name }}"
echo "X=${PARTS[0]}" >> $GITHUB_ENV
echo "Y=${PARTS[1]}" >> $GITHUB_ENV
echo "Z=${PARTS[2]}" >> $GITHUB_ENV
else
echo "Invalid tag format. Expected vX.Y.Z but got ${{ github.ref_name }}"
exit 1
fi

- name: "Verify tag was created in the proper release branch"
run: |
# Remove leading "v" from env.X
X_NO_V="${X:1}"
# Check if the tag was created in the proper branch
if [[ ${{ github.event.base_ref }} != "refs/heads/release/${X_NO_V}.${{ env.Y }}" ]]; then
echo "Tag ${{ github.ref_name }} was created in the wrong branch. Expected branch name release/${X_NO_V}.${{ env.Y }}"
exit 1
fi

- name: "Remove old tags"
run: |
git push --delete origin ${{ env.X }}
git push --delete origin ${{ env.X }}.${{ env.Y }}

- name: "Create new tags"
run: |
git tag ${{ env.X }}.${{ env.Y }}
git tag ${{ env.X }}
git push origin ${{ env.X }}.${{ env.Y }}
git push origin ${{ env.X }}
46 changes: 41 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -41,6 +45,7 @@ pip-delete-this-directory.txt
htmlcov/
.tox/
.nox/
.cov
.coverage
.coverage.*
.cache
Expand All @@ -50,6 +55,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -69,9 +75,10 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -82,15 +89,24 @@ profile_default/
ipython_config.py

# pyenv
.python-version
# For a library or package, you might want to ignore these files because the code is
# intended to run in multiple environments. Otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# According to pypa/pipenv#598, you should include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to the Pipfile.lock recommendation, you should generally include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility. This
# recommendation is commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

Expand Down Expand Up @@ -127,5 +143,25 @@ dmypy.json

# Pyre type checker
.pyre/
doc/_build/
*-rendered-example.yml

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into the gitignore. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# Visual Studio
.vs/
.vscode/

# End of https://www.toptal.com/developers/gitignore/api/python

# Ignore rendered examples
*-rendered-example.yml
21 changes: 15 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
repos:

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.2.0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args:
- --line-length=88

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-yaml
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: debug-statements

- repo: https://github.com/ansys/pre-commit-hooks
rev: v0.2.9
hooks:
- id: add-license-headers
files: '(tests)/.*\.(py)|./.*\.(yml)'
args:
- --start_year=2024
exclude: '^(.github|doc)/.*'

# Validate our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.22.0
rev: 0.28.0
hooks:
- id: check-github-workflows
- id: check-github-workflows
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Ansys SCADE
Copyright (c) 2024 ANSYS, Inc. All rights reserved.
jorgepiloto marked this conversation as resolved.
Show resolved Hide resolved

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading