From b8fa7b77fab1bcb95af1c03d53d53321d10ab7a3 Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Mon, 14 Apr 2025 15:16:09 +1200 Subject: [PATCH 1/6] [15] use reusable testing workflow --- .github/workflows/dev.yml | 6 ++- .github/workflows/run-tests.yml | 70 --------------------------------- 2 files changed, 4 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 0013820..9132833 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -9,6 +9,8 @@ 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]" 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) From 4a4f1c4084be1b2c9cdffe76be4570ae82fc9e3e Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Mon, 14 Apr 2025 15:19:30 +1200 Subject: [PATCH 2/6] fix args --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 9132833..277ff00 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -12,5 +12,5 @@ jobs: 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]" + python-versions: "['3.9', '3.10', '3.11']" secrets: inherit From c2283b47dc4c002860e3663e138ce8b7999f01b0 Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Mon, 14 Apr 2025 15:29:52 +1200 Subject: [PATCH 3/6] disable 3.9 --- .github/workflows/dev.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 277ff00..5e42aee 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -11,6 +11,7 @@ jobs: call-test-workflow: 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']" + operating-systems: "['ubuntu-latest', 'macos-latest', 'windows-latest']"\ + # re-enable 3.9 after https://github.com/GNS-Science/solvis-store/issues/17 + python-versions: "[ '3.10', '3.11']" #"['3.9', '3.10', '3.11']" secrets: inherit From 64c79cea4084cb3dabd1d5a8a729d0ec247564ff Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Mon, 14 Apr 2025 15:30:30 +1200 Subject: [PATCH 4/6] fix --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 5e42aee..1491849 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -11,7 +11,7 @@ jobs: call-test-workflow: uses: GNS-Science/nshm-github-actions/.github/workflows/python-run-tests.yml@main with: - operating-systems: "['ubuntu-latest', 'macos-latest', 'windows-latest']"\ + operating-systems: "['ubuntu-latest', 'macos-latest', 'windows-latest']" # re-enable 3.9 after https://github.com/GNS-Science/solvis-store/issues/17 python-versions: "[ '3.10', '3.11']" #"['3.9', '3.10', '3.11']" secrets: inherit From 4328d8af3b36b44c6659161ed8ce45bfaac7a018 Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Thu, 17 Apr 2025 11:42:29 +1200 Subject: [PATCH 5/6] WIP --- .github/workflows/dev.yml | 4 ++-- setup.cfg | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 1491849..f9aa8a8 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -12,6 +12,6 @@ jobs: uses: GNS-Science/nshm-github-actions/.github/workflows/python-run-tests.yml@main with: operating-systems: "['ubuntu-latest', 'macos-latest', 'windows-latest']" - # re-enable 3.9 after https://github.com/GNS-Science/solvis-store/issues/17 - python-versions: "[ '3.10', '3.11']" #"['3.9', '3.10', '3.11']" + python-versions: "['3.9', '3.10', '3.11']" + fail-fast: false secrets: inherit diff --git a/setup.cfg b/setup.cfg index bb65a30..67acc26 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 = macos +allowlist_externals = + poetry +extras = + dev +commands = + poetry build From cb8d365251c4d040d6c9e2937dfa89a2f807d59b Mon Sep 17 00:00:00 2001 From: Oakley Jurgens Date: Thu, 17 Apr 2025 11:55:17 +1200 Subject: [PATCH 6/6] fix macos --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 67acc26..f1c3e4f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -91,7 +91,7 @@ commands = poetry build [testenv:build-macos] -platform = macos +platform = darwin allowlist_externals = poetry extras =