-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (75 loc) · 2.39 KB
/
python-ci.yml
File metadata and controls
94 lines (75 loc) · 2.39 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# This workflow will for a variety of Python versions
# - install the code base with pixi
# - lint the code base
# - test the code base
# - upload the test coverage to codecov
#
# It will also
# - build the package
# - check the package
#
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: CI using pixi
on: [push, pull_request]
jobs:
Code_Consistency:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Pixi
uses: ./.github/actions/setup-pixi
- name: Run linting
run: pixi run lint
- name: Suggestion to fix lint issues
if: ${{ failure() }}
run: |
echo "::notice::In project root run 'pixi run lint-fix' and commit changes to fix issues."
exit 1
- name: Run formatting
run: pixi run format-check
- name: Suggestion to fix format issues
if: ${{ failure() }}
run: |
echo "::notice::In project root run 'pixi run format' and commit changes to fix issues."
exit 1
Code_Testing:
strategy:
max-parallel: 4
matrix:
python-version: ['3.11', '3.12', '3.13']
os: [ubuntu-latest, macos-latest, macos-15-intel, windows-latest]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v5
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.0
with:
run-install: false
cache: false
post-cleanup: false
- name: Set Python version
run: pixi add python=${{ matrix.python-version }}
- name: Install dependencies and run tests
run: pixi run -e dev test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
name: unit-tests-job
flags: unittests
files: ./coverage-unit.xml
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
slug: EasyScience/corelib
Package_Testing:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v5
- name: Setup Pixi
uses: ./.github/actions/setup-pixi
- name: Build package
run: pixi run build
- name: Run tox tests
run: pixi run tox