diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 0013820..f9aa8a8 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -9,6 +9,9 @@ on: jobs: call-test-workflow: - #https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow - uses: ./.github/workflows/run-tests.yml + uses: GNS-Science/nshm-github-actions/.github/workflows/python-run-tests.yml@main + with: + operating-systems: "['ubuntu-latest', 'macos-latest', 'windows-latest']" + python-versions: "['3.9', '3.10', '3.11']" + fail-fast: false secrets: inherit diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml deleted file mode 100644 index b69801e..0000000 --- a/.github/workflows/run-tests.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Run Tests - -#https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow - -on: - workflow_call: - -jobs: - run_unit_tests: - runs-on: ubuntu-latest - timeout-minutes: 10 - strategy: - matrix: - python-versions: ["3.9", "3.10", "3.11"] - os: [ubuntu-latest, macos-latest, windows-latest] - - env: - OS: ${{ matrix.os }} - PYTHON: ${{ matrix.python-version }} - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-versions }} - - - name: Install and configure Poetry - uses: GNS-Science/install-poetry@main - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - #---------------------------------------------- - # load cached venv if cache exists - #---------------------------------------------- - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-run-tests - - #---------------------------------------------- - # install dependencies if cache does not exist - #---------------------------------------------- - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: | - poetry install --no-interaction --no-root --with dev --all-extras - poetry add tox-gh-actions - - - name: test with tox (uses tox-gh-actions to select correct environment) - run: - poetry run tox - - - name: list files - run: ls -l . - - - name: Submit coverage report - uses: codecov/codecov-action@v4 - with: - files: ./coverage.xml # optional - flags: unittests # optional - name: codecov-umbrella # optional - token: ${{ secrets.CODECOV_TOKEN }} # required - # verbose: true # optional (default = false) - env_vars: OS,PYTHON - fail_ci_if_error: true # optional (default = false) diff --git a/setup.cfg b/setup.cfg index bb65a30..f1c3e4f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,7 +40,7 @@ exclude_lines = [tox:tox] isolated_build = true -envlist = py39, py310, py311, py312, format, lint, build +envlist = py39, py310, py311, py312, format, lint, build-linux, build-macos [gh-actions] python = @@ -81,10 +81,20 @@ commands = flake8 solvis_store tests mypy solvis_store tests -[testenv:build] +[testenv:build-linux] +platform = linux allowlist_externals = - poetry + poetry extras = - dev + dev commands = - poetry build + poetry build + +[testenv:build-macos] +platform = darwin +allowlist_externals = + poetry +extras = + dev +commands = + poetry build