Repository navigation
66 lines (61 loc) · 1.8 KB
/
Copy pathci.yml
File metadata and controls
66 lines (61 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: 3.x
# Not pre-commit/action: it calls actions/cache by tag, which the organization policy rejects.
- name: Install pre-commit
run: pip install pre-commit==4.7.0
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color=always
unittest:
name: Unit test - ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- py311
- py312
- py313
- py314
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Apply workarounds
run: |
# Workaround for https://github.com/prefix-dev/pixi/issues/3762
sed -i.bak 's@editable = true@editable = false@g' pyproject.toml
rm pyproject.toml.bak
# Show any changes
git diff
- uses: prefix-dev/setup-pixi@9936258fee697aff89b3fed6ca1f80a382ef694e # v0.11.3
with:
pixi-version: v0.84.2
cache: false
environments: ${{ matrix.python-version }}
- name: Run pytest
env:
PIXI_ENV: ${{ matrix.python-version }}
run: pixi run -e "$PIXI_ENV" pytest