Skip to content

Commit

Permalink
Merge pull request #20 from acsone/fix-ci-sbi
Browse files Browse the repository at this point in the history
Fix CI to run with selected python version, and other improvements
  • Loading branch information
sbidoul authored Jun 7, 2024
2 parents d1cf06a + a672e84 commit 1735260
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
22 changes: 3 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,12 @@ jobs:
- os: macos-latest
python-version: "3.12"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install hatch
run: pipx install hatch
- name: Run tests
run: hatch run cov

publish:
runs-on: ubuntu-latest
needs:
- test
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Build a binary wheel and a source tarball
run: pipx run build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_token }}
run: hatch run +py=${{ matrix.python-version }} test:cov
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ source = "vcs"
[tool.hatch.build]
exclude = [".github"]

[tool.hatch.envs.default]
[tool.hatch.envs.test]
dependencies = [
"editables",
"build",
"pytest",
"pytest-cov",
]
[tool.hatch.envs.default.scripts]
[tool.hatch.envs.test.scripts]
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/hatch_odoo --cov=tests -v"
no-cov = "cov --no-cov"

[[tool.hatch.envs.test.matrix]]
python = ["37", "38", "39", "310", "311", "312"]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.coverage.run]
branch = true
Expand Down

0 comments on commit 1735260

Please sign in to comment.