From dc604e10ceca14bbe563bedec6c6e7c41b7d7043 Mon Sep 17 00:00:00 2001 From: Mathieu Le Marec - Pasquet Date: Thu, 31 Oct 2024 15:43:19 +0200 Subject: [PATCH] enhance ci --- .github/workflows/cicd.yml | 44 +++++++++++++++++++------------------- README.rst | 2 +- tox.ini | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 7618818..76cd470 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -32,6 +32,27 @@ jobs: venv2/bin/python2 -m pip install pytest -r <(grep -v pytest ./requirements/base.txt) venv2/bin/pytest src + test-code-QA: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.13"] + steps: + - uses: actions/checkout@v4 + - name: Cache tox environments + uses: actions/cache@v4 + with: + path: .tox + key: ${{ runner.os }}-${{ matrix.python }}-toxQA + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: {python-version: "${{ matrix.python-version }}", cache: pip, cache-dependency-path: 'requirements/*.txt'} + - name: install tests dependencies + run: pip install -r requirements/test.txt -r requirements/lint.txt -r requirements/tox.txt -r requirements/format.txt + - name: formatters check + run: tox --current-env -e lint,fmt + test-py3: runs-on: ubuntu-latest strategy: @@ -49,9 +70,7 @@ jobs: uses: actions/setup-python@v5 with: {python-version: "${{ matrix.python-version }}", cache: pip, cache-dependency-path: 'requirements/*.txt'} - name: install tests dependencies - run: pip install -r requirements/test.txt -r requirements/lint.txt -r requirements/tox.txt - - name: run lint - run: tox --current-env -e lint + run: pip install -r requirements/test.txt -r requirements/tox.txt - name: run tests with coverage run: tox --current-env -e cov @@ -70,22 +89,3 @@ jobs: docker compose run --rm app tox --current-env -e test env: {COMPOSE_FILE: "docker-compose.yml:docker-compose-32bits.yml"} - formatting: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Cache tox environments - uses: actions/cache@v4 - with: - path: .tox - key: ${{ runner.os }}-3.13-tox - - name: Set up Python 3.13 - uses: actions/setup-python@v5 - with: - python-version: 3.13 - cache: pip - cache-dependency-path: 'requirements/*.txt' - - name: install format dependencies - run: pip install -r requirements/format.txt -r requirements/tox.txt - - name: run format - run: tox --current-env -e check-format diff --git a/README.rst b/README.rst index c72bf4f..7f2bb80 100644 --- a/README.rst +++ b/README.rst @@ -341,8 +341,8 @@ Develop this package cd croniter virtualenv --no-site-packages venv3 venv3/bin/pip install --upgrade -r requirements/test.txt -r requirements/lint.txt -r requirements/format.txt -r requirements/tox.txt - venv3/bin/tox --current-env -e lint,test venv3/bin/black src/ + venv3/bin/tox --current-env -e fmt,lint,test Testing under py2 diff --git a/tox.ini b/tox.ini index d3fd641..db29f6f 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ deps = -r{toxinidir}/requirements/lint.txt changedir = src commands = flake8 croniter/croniter.py -[testenv:check-format] +[testenv:fmt] deps = -r{toxinidir}/requirements/format.txt changedir = src commands = black --check .