|
4 | 4 | # https://github.com/codecov/codecov-action |
5 | 5 |
|
6 | 6 | name: Build and test linkml-runtime |
7 | | - |
| 7 | +env: |
| 8 | + UV_VERSION: "0.7.13" |
8 | 9 | on: |
9 | 10 | push: |
10 | 11 | branches: |
11 | | - - main |
| 12 | + - main |
12 | 13 | pull_request: |
13 | 14 | workflow_dispatch: |
14 | 15 |
|
15 | 16 | jobs: |
| 17 | + quality-checks: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v5.0.0 |
| 21 | + - name: Install uv |
| 22 | + uses: astral-sh/setup-uv@v6.8.0 |
| 23 | + with: |
| 24 | + version: ${{ env.UV_VERSION }} |
| 25 | + enable-cache: true |
| 26 | + - uses: actions/setup-python@v6.0.0 |
| 27 | + with: |
| 28 | + python-version: 3.13 |
| 29 | + - name: Install tox |
| 30 | + run: python -m pip install tox |
| 31 | + - name: Run codespell |
| 32 | + run: tox -e codespell |
| 33 | + - name: Run code format checks |
| 34 | + run: tox -e format_check |
| 35 | + |
16 | 36 | test: |
| 37 | + needs: |
| 38 | + - quality-checks |
17 | 39 | strategy: |
18 | 40 | fail-fast: false |
19 | 41 | matrix: |
20 | 42 | os: [ubuntu-latest, windows-latest] |
21 | 43 | python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
| 44 | + # Test on Windows with only the oldest and newest Python versions |
22 | 45 | exclude: |
23 | | - - os: windows-latest |
24 | | - python-version: "3.10" |
25 | | - - os: windows-latest |
26 | | - python-version: "3.11" |
27 | | - - os: windows-latest |
28 | | - python-version: "3.12" |
| 46 | + - os: windows-latest |
| 47 | + python-version: "3.10" |
| 48 | + - os: windows-latest |
| 49 | + python-version: "3.11" |
| 50 | + - os: windows-latest |
| 51 | + python-version: "3.12" |
| 52 | + # See https://github.com/snok/install-poetry#running-on-windows |
| 53 | + defaults: |
| 54 | + run: |
| 55 | + shell: bash |
29 | 56 |
|
30 | 57 | runs-on: ${{ matrix.os }} |
31 | 58 |
|
32 | 59 | steps: |
33 | | - |
34 | | - #---------------------------------------------- |
35 | | - # install poetry |
36 | | - #---------------------------------------------- |
37 | | - - name: Install Poetry |
38 | | - run: | |
39 | | - pipx install poetry |
40 | | - pipx inject poetry poetry-dynamic-versioning |
41 | | -
|
42 | | - #---------------------------------------------- |
43 | | - # check-out repo and set-up python |
44 | | - #---------------------------------------------- |
45 | 60 | - name: Check out repository |
46 | | - uses: actions/checkout@v4.2.2 |
| 61 | + uses: actions/checkout@v5.0.0 |
47 | 62 | with: |
48 | 63 | fetch-depth: 0 |
49 | 64 |
|
50 | | - - name: Set up Python ${{ matrix.python-version }} |
51 | | - uses: actions/setup-python@v5.6.0 |
| 65 | + #---------------------------------------------- |
| 66 | + # install uv |
| 67 | + #---------------------------------------------- |
| 68 | + - name: Install uv |
| 69 | + uses: astral-sh/setup-uv@v6.8.0 |
52 | 70 | with: |
| 71 | + version: ${{ env.UV_VERSION }} |
| 72 | + enable-cache: true |
| 73 | + cache-dependency-glob: "uv.lock" |
53 | 74 | python-version: ${{ matrix.python-version }} |
54 | | - cache: 'poetry' |
55 | 75 |
|
56 | 76 | #---------------------------------------------- |
57 | | - # install your root project, if required |
58 | | - #---------------------------------------------- |
59 | | - - name: Install library |
| 77 | + # install your root project, if required |
| 78 | + #---------------------------------------------- |
| 79 | + - name: Install dependencies |
60 | 80 | run: | |
61 | | - poetry install --no-interaction |
| 81 | + uv sync --group dev |
| 82 | +
|
| 83 | + - name: Verify uv.lock is up-to-date |
| 84 | + run: uv lock --check |
62 | 85 |
|
63 | 86 | #---------------------------------------------- |
64 | | - # coverage report |
| 87 | + # coverage report |
65 | 88 | #---------------------------------------------- |
66 | 89 | - name: Generate coverage results |
67 | 90 | # Set bash shell to fail correctly on Windows https://github.com/actions/runner-images/issues/6668 |
68 | 91 | shell: bash |
69 | 92 | run: | |
70 | | - poetry run coverage run -m pytest |
71 | | - poetry run coverage xml |
72 | | - poetry run coverage report -m |
| 93 | + uv run coverage run -m pytest |
| 94 | + uv run coverage xml |
| 95 | + uv run coverage report -m |
73 | 96 |
|
74 | 97 | #---------------------------------------------- |
75 | 98 | # upload coverage results |
76 | 99 | #---------------------------------------------- |
77 | 100 | - name: Upload coverage report |
78 | | - uses: codecov/codecov-action@v5 |
| 101 | + uses: codecov/codecov-action@v5.5.1 |
79 | 102 | with: |
80 | 103 | name: codecov-results-${{ matrix.os }}-${{ matrix.python-version }} |
81 | 104 | token: ${{ secrets.CODECOV_TOKEN }} |
|
0 commit comments