Skip to content

Commit

Permalink
CI: Improve CICD
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Oct 25, 2024
1 parent 58193fe commit c2d0321
Showing 1 changed file with 45 additions and 43 deletions.
88 changes: 45 additions & 43 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,6 @@ concurrency:

jobs:

test-unit:
name: Running unit tests
runs-on: ubuntu-latest
steps:
- name: Run unit tests
uses: ansys/actions/tests-pytest@feat/add-install-target-to-test-pytest
with:
pytest-markers: -m unit
pytest-extra-args: ${{ env.PYTEST_ARGUMENTS }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
optional-dependencies-name: unit-tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-unit-tests
file: ./coverage.xml
flags: unit

- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-unit
path: junit/test-results.xml
if: ${{ always() }}

pr-title:
if: github.event_name == 'pull_request'
name: Check the title of the pull request
Expand All @@ -68,7 +41,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
use-upper-case: true

# TODO: Update to ansys/actions/doc-style@v6
doc-style:
name: Documentation style check
runs-on: ubuntu-latest
Expand All @@ -78,6 +50,19 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

doc-build:
name: Documentation build
runs-on: ubuntu-latest
needs: [doc-style]
steps:
- name: Documentation build
uses: ansys/actions/doc-build@v8
with:
dependencies: "graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra"
python-version: ${{ env.MAIN_PYTHON_VERSION }}
sphinxopts: '-j auto --color -w build_errors.txt'
check-links: false

smoke-tests:
name: Build wheelhouse and smoke tests
runs-on: ${{ matrix.os }}
Expand All @@ -100,25 +85,41 @@ jobs:
run: |
python -c "import ansys.aedt.core; from ansys.aedt.core import __version__"
doc-build:
name: Documentation build
unit-tests:
name: Running unit tests
needs: [smoke-tests]
runs-on: ubuntu-latest
needs: [doc-style]
steps:
- name: Documentation build
uses: ansys/actions/doc-build@v8
- name: Run unit tests
uses: ansys/actions/tests-pytest@v8
with:
dependencies: "graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra"
pytest-markers: -m unit
pytest-extra-args: ${{ env.PYTEST_ARGUMENTS }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
sphinxopts: '-j auto --color -w build_errors.txt'
check-links: false
optional-dependencies-name: unit-tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-unit-tests
file: ./coverage.xml
flags: unit

- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-unit
path: junit/test-results.xml
if: ${{ always() }}

# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================

test-solvers-windows:
system-tests-solvers-windows:
name: Testing solvers and coverage (Windows)
needs: [unit-tests]
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
Expand Down Expand Up @@ -175,9 +176,9 @@ jobs:
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================

# TODO: Si if we can use ansys/actions
test-solvers-linux:
system-tests-solvers-linux:
name: Testing solvers and coverage (Linux)
needs: [unit-tests]
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, Linux, pyaedt ]
env:
Expand Down Expand Up @@ -232,8 +233,9 @@ jobs:
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================

test-windows:
system-tests-general-windows:
name: Testing and coverage (Windows)
needs: [unit-tests]
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
Expand Down Expand Up @@ -296,9 +298,9 @@ jobs:
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================

# TODO: Si if we can use ansys/actions
test-linux:
system-tests-general-linux:
name: Testing and coverage (Linux)
needs: [unit-tests]
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, Linux, pyaedt ]
env:
Expand Down Expand Up @@ -363,7 +365,7 @@ jobs:

package:
name: Package library
needs: [test-windows, test-solvers-windows, test-linux, test-solvers-linux, doc-build]
needs: [system-tests-general-windows, system-tests-solvers-windows, system-tests-solvers-windows, system-tests-solvers-linux, doc-build]
runs-on: ubuntu-latest
steps:
- name: Build library source and wheel artifacts
Expand Down

0 comments on commit c2d0321

Please sign in to comment.