From 9ce0acb0072aeccdf10df33b6a131b56455bd2c9 Mon Sep 17 00:00:00 2001 From: Ivar Stangeby Date: Fri, 7 Jun 2024 20:55:23 +0200 Subject: [PATCH] add pytest ci --- .github/workflows/ci_tests.yaml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/ci_tests.yaml diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml new file mode 100644 index 0000000..304d91d --- /dev/null +++ b/.github/workflows/ci_tests.yaml @@ -0,0 +1,38 @@ +name: Upload Python Package To PyPi Test + +on: + push + +jobs: + ci: + strategy: + fail-fast: false + matrix: + python-version: [ "3.8", "3.9", "3.10", "3.11" ] + poetry-version: [ "1.2.2", "1.7.1" ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + # see details (matrix, python-version, python-version-file, etc.) + # https://github.com/actions/setup-python + - name: Install poetry + uses: abatilo/actions-poetry@v2 + with: + poetry-version: ${{ matrix.poetry-version }} + - name: Setup a local virtual environment (if no poetry.toml file) + run: | + poetry config virtualenvs.create true --local + poetry config virtualenvs.in-project true --local + - uses: actions/cache@v3 + name: Define a cache for the virtual environment based on the dependencies lock file + with: + path: ./.venv + key: venv-${{ hashFiles('poetry.lock') }} + - name: Install the project dependencies + run: poetry install + - name: Run the automated tests (for example) + run: poetry run pytest -v