Skip to content

Commit

Permalink
wip: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-cty committed Apr 28, 2024
1 parent 7598e87 commit 729f964
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Test package
run: hatch run test:package
run:
- pipx install hatch
- hatch run test:package

build_server:
runs-on: ubuntu-latest
Expand All @@ -34,9 +36,11 @@ jobs:
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Unit tests on api with tox
run: |
cd carbonserver/
tox -e unit -vv
run:
- pipx install hatch
- hatch run api:test-unit
# cd carbonserver/
# tox -e unit -vv

test_api_server:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -72,11 +76,12 @@ jobs:
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
cd carbonserver
pip install -r requirements-dev.txt
pip install tox tox-gh-actions
run: pipx install hatch

# python -m pip install --upgrade pip
# cd carbonserver
# pip install -r requirements-dev.txt
# pip install tox tox-gh-actions

- name: Setup PostgreSQL
# Runs a script that creates a PostgreSQL table, populates
Expand All @@ -94,7 +99,7 @@ jobs:
uvicorn main:app --host 0.0.0.0 --port 8008 &
sleep 2
netstat -o -n -a | grep 8008
tox -e integration
hatch run api:test-integ
# Environment variables used by the `client.js` script to create a new PostgreSQL table.
env:
# The hostname used to communicate with the PostgreSQL service container
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: |
pip install pre-commit==3.5.0
pip install pre-commit==3.7.0
pre-commit run --show-diff-on-failure --color=always --all-files
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ package = 'pytest -vv -m "not integ_test" tests/'
package-integ = 'python -m pytest -vv tests/'

[[tool.hatch.envs.test.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# Python 3.7 does not works with pip-tools
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.docs.scripts]
build = "cd docs/edit && make docs"
Expand Down

0 comments on commit 729f964

Please sign in to comment.