Start using uv instead of pip (#45) #210
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: tox | |
on: | |
push: # only publishes pushes to the main branch to TestPyPI | |
branches: # any integration branch but not tag | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
concurrency: | |
# Avoids canceling push to main of the same commit (github.sha) but will | |
# cancel running builds when you update the source branch of a PR. | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}-${{ github.event.number || github.sha }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: 1 # tox, pytest, ansible-lint | |
PY_COLORS: 1 | |
jobs: | |
pre: | |
name: pre | |
runs-on: ubuntu-24.04 | |
outputs: | |
matrix: ${{ steps.generate_matrix.outputs.matrix }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Determine matrix | |
id: generate_matrix | |
uses: ./ | |
with: | |
min_python: "3.10" | |
max_python: "3.13" | |
default_python: "3.10" | |
other_names: lint | |
build: | |
name: ${{ matrix.name || '?' }} | |
runs-on: ${{ matrix.os || 'ubuntu-24.04' }} | |
needs: pre | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.pre.outputs.matrix) }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python_version }} | |
uses: actions/setup-python@v5 | |
with: | |
cache-dependency-path: .config/requirements*.in | |
cache: pip | |
python-version: ${{ matrix.python_version }} | |
- run: python3 -m pip install -U uv tox tox-uv | |
- run: "${{ matrix.command }}" | |
codeql: | |
name: codeql | |
runs-on: ubuntu-24.04 | |
needs: | |
- build | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ["python"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Initializes the CodeQL tools for scanning. | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
# If you wish to specify custom queries, you can do so here or in a config file. | |
# By default, queries listed here will override any specified in a config file. | |
# Prefix the list here with "+" to use these queries and those in the config file. | |
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | |
# queries: security-extended,security-and-quality | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v3 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/language:${{matrix.language}}" | |
check: # This job does nothing and is only used for the branch protection | |
if: always() | |
permissions: | |
pull-requests: write # allow to comment on pull-request | |
needs: | |
- build | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
- name: Check out src from Git | |
uses: actions/checkout@v4 |