From 719f115e612d2955a7639e96da2debeb1d830286 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:41:16 +0200 Subject: [PATCH] CI: Lint and test via uv (#652) --- .github/workflows/ci.yml | 23 +++++++++++++++-------- .github/workflows/lint.yml | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87ac5396..983a11fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,15 +2,16 @@ name: Tests on: [push, pull_request, workflow_dispatch] +permissions: + contents: read + env: FORCE_COLOR: 1 jobs: test: name: Python ${{ matrix.python-version }} - runs-on: ubuntu-latest - strategy: fail-fast: false matrix: @@ -18,21 +19,27 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 id: python-install with: python-version: ${{ matrix.python-version }} - cache: pip + allow-prereleases: true + + - name: Install uv + uses: hynek/setup-cached-uv@v2 + with: cache-dependency-path: | requirements.txt dev-requirements.txt - allow-prereleases: true - - name: Install tox + + - name: Tox tests run: | - python -m pip install tox - - name: Run Tests - run: tox -e py + uvx --with tox-uv tox -e py + - uses: codecov/codecov-action@v4 if: always() with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..e535eb6f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: Lint + +on: [push, pull_request, workflow_dispatch] + +env: + FORCE_COLOR: 1 + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - uses: tox-dev/action-pre-commit-uv@v1