From 064780f52ce923d2dd15c532759982c76bb558d7 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 27 Oct 2023 14:43:01 +0200 Subject: [PATCH] WIP: add legacy unit tests --- .github/workflows/legacy_unit_tests.yml | 64 +++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/legacy_unit_tests.yml diff --git a/.github/workflows/legacy_unit_tests.yml b/.github/workflows/legacy_unit_tests.yml new file mode 100644 index 0000000000..fd25d0ce0b --- /dev/null +++ b/.github/workflows/legacy_unit_tests.yml @@ -0,0 +1,64 @@ +name: CI + +env: + python.version: '3.10' + python.venv: 'testvenv' + # Following env vars when changed will "reset" the mentioned cache, + # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... + # You should go up in number, if you go down (or repeat a previous value) + # you might end up reusing a previous cache if it hasn't been deleted already. + # It applies 7 days retention policy by default. + RESET_PIP_CACHE: 0 + PACKAGE_NAME: PyEDB +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + tags: + - 'v*' + branches: + - main + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build_solvers: + # The type of runner that the job will run on + runs-on: [ windows, pyedb, self-hosted ] + strategy: + matrix: + python-version: [ '3.10' ] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: "Install Git and clone project" + uses: actions/checkout@v4 + if: ${{ inputs.checkout == 'true' }} + + - name: "Set up Python" + uses: ansys/actions/_setup-python@main + with: + python-version: ${{ inputs.python-version }} + use-cache: ${{ inputs.use-python-cache }} + + - name: "Update pip" + shell: bash + run: python -m pip install -U pip + + - name: "Install Python library" + shell: bash + run: python -m pip install . + + - name: "Install test requirements" + shell: bash + run: python -m pip install .[tests] + + - name: "Executing legacy unit tests" + shell: bash + run: | + pytest -n 6 -m "legacy and unit"