-
Notifications
You must be signed in to change notification settings - Fork 4
100 lines (91 loc) · 2.93 KB
/
check.yml
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
95
96
97
98
99
100
name: check
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'alibaba/code-data-share-for-python' }}
jobs:
test-cpython:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# for actions/setup-python:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
python: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
os: [ ubuntu-latest, macOS-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox
- name: Unit tests
run: nox -s tests_venv_current
test-conda:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macOS-latest, windows-latest ]
conda-py: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v4
- uses: s-weigand/setup-conda@v1
with:
conda-channels: conda-forge
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox
- name: Test with pytest
run: |
nox -s tests_multiple_conda-${{ matrix.conda-py }}
- name: Test imports
run: |
nox -s test_import_third_party-${{ matrix.conda-py }}
- name: Setup tmate session
if: ${{ failure() && false }}
uses: mxschmitt/action-tmate@v3
test-twine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox twine
- name: Build sdist to test
run: |
nox -s build_sdist
- name: Test with twine
run: |
twine check dist/*.tar.gz
check-format:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Run clang-format style check
uses: jidicula/[email protected]
with:
clang-format-version: '13'
check-path: 'src/_cds'
exclude-regex: '(clinic|pythoncapi_compat)'