mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-09 11:50:37 +00:00
add nox and test against different Python and Django versions (#91)
This commit is contained in:
parent
074c10bb94
commit
d38ee4361d
5 changed files with 206 additions and 17 deletions
7
.github/workflows/lint.yml
vendored
7
.github/workflows/lint.yml
vendored
|
@ -6,6 +6,10 @@ on:
|
|||
branches: [main]
|
||||
workflow_call:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
|
@ -13,7 +17,6 @@ env:
|
|||
CARGO_TERM_COLOR: always
|
||||
FORCE_COLOR: "1"
|
||||
PYTHONUNBUFFERED: "1"
|
||||
UV_VERSION: "0.4.x"
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
|
@ -25,7 +28,7 @@ jobs:
|
|||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
version: ${{ env.UV_VERSION }}
|
||||
pyproject-file: pyproject.toml
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
|
|
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
|
@ -12,8 +12,14 @@ on:
|
|||
tags:
|
||||
- "*"
|
||||
pull_request:
|
||||
branches:
|
||||
- "release/*"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: test-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
|
|
44
.github/workflows/test.yml
vendored
44
.github/workflows/test.yml
vendored
|
@ -5,9 +5,14 @@ on:
|
|||
push:
|
||||
branches: [main]
|
||||
workflow_call:
|
||||
inputs:
|
||||
os:
|
||||
description: "Comma-delineated list of OS targets to run tests on"
|
||||
required: false
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: test-${{ github.head_ref }}
|
||||
group: ${{ github.workflow }}-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
|
@ -16,15 +21,10 @@ env:
|
|||
PYTHONUNBUFFERED: "1"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- macos-latest
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
generate-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
@ -34,10 +34,26 @@ jobs:
|
|||
enable-cache: true
|
||||
pyproject-file: pyproject.toml
|
||||
|
||||
- name: Install dependencies and build
|
||||
- id: set-matrix
|
||||
run: |
|
||||
uv sync --frozen
|
||||
uv run maturin build
|
||||
uv run noxfile.py --session gha_matrix -- "${{ inputs.os }}"
|
||||
|
||||
test:
|
||||
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (${{ matrix.os }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: generate-matrix
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
pyproject-file: pyproject.toml
|
||||
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
run: |
|
||||
uv run noxfile.py --session "tests(python='${{ matrix.python-version }}', django='${{ matrix.django-version }}')"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue