Skip to content

feat: technical review #41

feat: technical review

feat: technical review #41

Workflow file for this run

name: CI
on:
pull_request:
workflow_dispatch:
push:
tags:
- "v*.*.*"
branches:
- main
env:
MAIN_SCADE_VERSION: '23.2'
MAIN_PYTHON_VERSION: '3.10'
DOCUMENTATION_CNAME: 'actions.scade.docs.pyansys.com'
test-library-name: 'ansys-scade-actions'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
labeler:
name: "Label syncer"
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: micnncim/action-label-syncer@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Label based on changed files
uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.head.ref, 'doc') ||
startsWith(github.event.pull_request.head.ref, 'docs')
with:
labels: documentation
- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.head.ref, 'maint') ||
startsWith(github.event.pull_request.head.ref, 'no-ci') ||
startsWith(github.event.pull_request.head.ref, 'ci')
with:
labels: maintenance
- uses: actions-ecosystem/action-add-labels@v1
if: startsWith(github.event.pull_request.head.ref, 'feat')
with:
labels: |
enhancement
- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.head.ref, 'fix') ||
startsWith(github.event.pull_request.head.ref, 'patch')
with:
labels: bug
- name: Suggest to add labels
uses: peter-evans/create-or-update-comment@v4
if: toJSON(github.event.pull_request.labels.*.name) == '{}'
with:
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/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
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ansys/actions/branch-name-style@main
code-style:
name: "Code style"
runs-on: ubuntu-latest
needs: commit-and-branch-style
steps:
- name: "Run code style checks"
uses: ansys/actions/code-style@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false
- name: "Verify private actions are not pointing to the 'main' branch"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
run: |
if $(grep -q --exclude-dir={.git,.github,doc} "ansys\/actions\/.*\@main" -r .); then
echo -e "\033[1;91m[ERROR]: Found private actions pointing to the 'main' branch.\033[0m"
grep -q --exclude-dir={.git,.github,doc} "ansys\/actions\/.*\@main" -r .
fi
doc-style:
name: "Doc style"
runs-on: ubuntu-latest
needs: commit-and-branch-style
steps:
- name: "Run documentation style checks"
uses: ansys/actions/doc-style@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
doc-build:
name: "Doc build"
runs-on: ubuntu-latest
needs: doc-style
steps:
- name: "Build documentation"
uses: ansys/actions/doc-build@v5
with:
skip-install: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false
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 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-pyproject"
pytest-postargs: "tests/python-pyproject/tests -vv"
checkout: false
doc-deploy-dev:
name: "Deploy developers documentation"
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 }}