From ea535606bc3a1b6d964cabcf479d1387c66d694f Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Fri, 20 Sep 2024 09:28:07 +0200 Subject: [PATCH] Add GH CI workflow --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++ .github/workflows/pypi.yml | 4 ++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..75c4b04 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + branches: ["master"] + pull_request: + +jobs: + # TODO + # pre-commit: + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v2 + # - uses: actions/setup-python@v2 + # with: + # python-version: "3.11" + # - uses: pre-commit/action@v2.0.0 + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - PYTHON_VERSION: "3.9" + os: ubuntu-latest + - PYTHON_VERSION: "3.10" + os: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{matrix.PYTHON_VERSION}} + - name: Configure TOX + run: | + pip install pip --upgrade + pip install tox codecov tox-gh-actions wheel + - name: Generate Report + run: | + pip install coverage + pip install .[test] + coverage run -m unittest + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index fafddda..ddbbdf7 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,6 +1,10 @@ name: PYPI Publish on: + + workflow_run: + # Depend on the CI workflow + workflows: ["CI"] pull_request: push: branches: