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 7 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
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"
72 changes: 62 additions & 10 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ 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+)
- [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)
Expand All @@ -84,12 +84,13 @@ jobs:
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 @@ -137,20 +138,17 @@ jobs:
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 setup.py 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
- name: "Execute pyproject tests"
uses: ./scade-tests-pytest
with:
scade-version: ${{ matrix.scade-version }}
Expand All @@ -160,11 +158,65 @@ jobs:

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 }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ repos:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: check-github-workflows
- id: check-github-workflows
32 changes: 16 additions & 16 deletions create-scade-venv/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ runs:
- name: Pass Inputs to Shell
shell: cmd
run: |
:: Pass inputs to the shell
echo INPUT_PYTHON_DIR=${{ inputs.python-dir }}>> %GITHUB_ENV%
echo INPUT_TARGET_DIR=${{ inputs.target-dir }}>> %GITHUB_ENV%
echo INPUT_TARGET_NAME=${{ inputs.target-name}}>> %GITHUB_ENV%
:: Pass inputs to the shell
echo INPUT_PYTHON_DIR=${{ inputs.python-dir }}>> %GITHUB_ENV%
echo INPUT_TARGET_DIR=${{ inputs.target-dir }}>> %GITHUB_ENV%
echo INPUT_TARGET_NAME=${{ inputs.target-name}}>> %GITHUB_ENV%

- name: Create environment
id: venv
shell: cmd
run: |
:: Create virtual environment
set VENV=%INPUT_TARGET_DIR%\%INPUT_TARGET_NAME%
if not exist "%VENV%" (
echo Create virtual environment "%VENV%"
"%INPUT_PYTHON_DIR%\python.exe" -m venv "%VENV%"
) else (
echo Skip existing virtual environment "%VENV%"
)
rem add the environment to the path
set PATH=%VENV%\Scripts;%PATH%
python --version
echo scripts-dir=%VENV%\Scripts>> %GITHUB_OUTPUT%
:: Create virtual environment
set VENV=%INPUT_TARGET_DIR%\%INPUT_TARGET_NAME%
if not exist "%VENV%" (
echo Create virtual environment "%VENV%"
"%INPUT_PYTHON_DIR%\python.exe" -m venv "%VENV%"
) else (
echo Skip existing virtual environment "%VENV%"
)
rem add the environment to the path
set PATH=%VENV%\Scripts;%PATH%
python --version
echo scripts-dir=%VENV%\Scripts>> %GITHUB_OUTPUT%
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# You can set these variables from the command line. You can also
# set the first two from the environment.
SPHINXOPTS ?=
SPHINXOPTS ?= -j auto -W
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = _build
Expand Down
26 changes: 13 additions & 13 deletions get-scade-dir/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ runs:
- name: Pass Inputs to Shell
shell: cmd
run: |
:: Pass Inputs to Shell
echo INPUT_SCADE_VERSION=${{ inputs.scade-version }}>> %GITHUB_ENV%
:: Pass Inputs to Shell
echo INPUT_SCADE_VERSION=${{ inputs.scade-version }}>> %GITHUB_ENV%

- name: Find SCADE_DIR
id: find-scade-dir
shell: cmd
run: |
:: Find SCADE_DIR
echo Searching for Ansys SCADE "%INPUT_SCADE_VERSION%"
if "%INPUT_SCADE_VERSION%" lss "21.2" (set SCADE_COMPANY=Esterel Technologies) else (set SCADE_COMPANY=Ansys Inc)
echo SCADE registry company is "%SCADE_COMPANY%"
for /f "usebackq skip=2 tokens=2,*" %%A in (`REG QUERY "HKLM\SOFTWARE\%SCADE_COMPANY%\SCADE\%INPUT_SCADE_VERSION%" /v InstallDir 2^>nul`) do (set SCADE_DIR=%%B)
if "%SCADE_DIR%" == "" (
echo Ansys SCADE "%INPUT_SCADE_VERSION%" not available
exit /b 1
)
echo Ansys SCADE %INPUT_SCADE_VERSION% found in "%SCADE_DIR%"
echo scade-dir=%SCADE_DIR%>> %GITHUB_OUTPUT%
:: Find SCADE_DIR
echo Searching for Ansys SCADE "%INPUT_SCADE_VERSION%"
if "%INPUT_SCADE_VERSION%" lss "21.2" (set SCADE_COMPANY=Esterel Technologies) else (set SCADE_COMPANY=Ansys Inc)
echo SCADE registry company is "%SCADE_COMPANY%"
for /f "usebackq skip=2 tokens=2,*" %%A in (`REG QUERY "HKLM\SOFTWARE\%SCADE_COMPANY%\SCADE\%INPUT_SCADE_VERSION%" /v InstallDir 2^>nul`) do (set SCADE_DIR=%%B)
if "%SCADE_DIR%" == "" (
echo Ansys SCADE "%INPUT_SCADE_VERSION%" not available
exit /b 1
)
echo Ansys SCADE %INPUT_SCADE_VERSION% found in "%SCADE_DIR%"
echo scade-dir=%SCADE_DIR%>> %GITHUB_OUTPUT%
49 changes: 24 additions & 25 deletions get-scade-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ description: >
inputs:
scade-dir:
description: >
Ansys SCADE Installation directory, e.g.::
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I tried the usage of back ticks but the rendering is not good, the path is split on two lines, that's why I've chosen the inlining of Python-like code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check this and try to resolve


C:\Program Files\Ansys Inc\v231\SCADE
Ansys SCADE Installation directory, for instance
``C:\Program Files\Ansys Inc\v231\SCADE``
required: true

outputs:
Expand All @@ -34,30 +33,30 @@ runs:
id: set
shell: cmd
run: |
:: Pass Inputs to Shell
echo INPUT_SCADE_DIR=${{ inputs.scade-dir }}>> %GITHUB_ENV%
:: Pass Inputs to Shell
echo INPUT_SCADE_DIR=${{ inputs.scade-dir }}>> %GITHUB_ENV%

- name: Retrieve Python name/directory/version
id: get
shell: cmd
run: |
:: Retrieve Python name/directory
setlocal ENABLEDELAYEDEXPANSION
echo Get Python interpreter for "%INPUT_SCADE_DIR%"
set PYTHON_VERSION=0
for /f "usebackq" %%A in (`dir /B "%INPUT_SCADE_DIR%\contrib\Python*"`) do (
set CURRENT_VERSION=%%A
set CURRENT_VERSION=!CURRENT_VERSION:Python=%!
if !CURRENT_VERSION! GTR !PYTHON_VERSION! (
set PYTHON_VERSION=!CURRENT_VERSION!
)
)
set PYTHON_NAME=Python%PYTHON_VERSION%
echo Python name="%PYTHON_NAME%"
echo python-name=%PYTHON_NAME%>> %GITHUB_OUTPUT%
set PYTHON_DIR=%INPUT_SCADE_DIR%\contrib\%PYTHON_NAME%
echo Python directory="%PYTHON_DIR%"
echo python-dir=%PYTHON_DIR%>> %GITHUB_OUTPUT%
for /f "usebackq tokens=2,3 delims=. " %%A in (`"%PYTHON_DIR%\python" --version`) do (set PYTHON_VERSION=%%A.%%B)
echo Python version="%PYTHON_VERSION%"
echo python-version=%PYTHON_VERSION%>> %GITHUB_OUTPUT%
:: Retrieve Python name/directory
setlocal ENABLEDELAYEDEXPANSION
echo Get Python interpreter for "%INPUT_SCADE_DIR%"
set PYTHON_VERSION=0
for /f "usebackq" %%A in (`dir /B "%INPUT_SCADE_DIR%\contrib\Python*"`) do (
set CURRENT_VERSION=%%A
set CURRENT_VERSION=!CURRENT_VERSION:Python=%!
if !CURRENT_VERSION! GTR !PYTHON_VERSION! (
set PYTHON_VERSION=!CURRENT_VERSION!
)
)
set PYTHON_NAME=Python%PYTHON_VERSION%
echo Python name="%PYTHON_NAME%"
echo python-name=%PYTHON_NAME%>> %GITHUB_OUTPUT%
set PYTHON_DIR=%INPUT_SCADE_DIR%\contrib\%PYTHON_NAME%
echo Python directory="%PYTHON_DIR%"
echo python-dir=%PYTHON_DIR%>> %GITHUB_OUTPUT%
for /f "usebackq tokens=2,3 delims=. " %%A in (`"%PYTHON_DIR%\python" --version`) do (set PYTHON_VERSION=%%A.%%B)
echo Python version="%PYTHON_VERSION%"
echo python-version=%PYTHON_VERSION%>> %GITHUB_OUTPUT%
2 changes: 1 addition & 1 deletion scade-tests-pytest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ runs:
uses: ./get-scade-dir
id: get-scade-dir
with:
scade-version: ${{ inputs.scade-version }}
scade-version: ${{ inputs.scade-version }}

- name: "Retrieve SCADE Python interpreter"
uses: ./get-scade-python
Expand Down
Loading
Loading