-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (88 loc) · 2.71 KB
/
ci.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
101
102
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- main
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
with:
extra_args: --hook-stage manual --all-files
- name: Run PyLint
run: |
echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
pipx run nox -s pylint
checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.sys.os }}
runs-on: ${{ matrix.sys.os }}
continue-on-error: ${{ matrix.experimental }}
needs: [pre-commit]
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
sys:
- { os: ubuntu-latest, shell: bash }
- { os: macos-latest, shell: bash }
experimental: [false]
exclude: []
# - sys: { os: macos-latest, shell: bash }
# python-version: 3.12
include:
- python-version: pypy-3.8
sys: { os: ubuntu-latest, shell: bash }
experimental: false
#- python-version: "3.9"
# sys: { os: windows-latest, shell: "msys2 {0}" }
# experimental: true
defaults:
run:
shell: ${{ matrix.sys.shell }}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
if: matrix.sys.os == 'windows-latest'
with:
update: true
install: >-
mingw-w64-x86_64-git mingw-w64-x86_64-autotools
mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-make
mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-pytest
mingw-w64-x86_64-ninja
- name: Install build tools (macos-latest)
if: matrix.sys.os == 'macos-latest'
run: brew install autoconf automake libtool
- uses: actions/setup-python@v5
if: matrix.sys.os != 'windows-latest'
with:
python-version: ${{ matrix.python-version }}
- name: Check build tools
run: |
which cmake
which make
which autoreconf
which python
- name: Install package
run: |
python -m pip install -U pip setuptools
python -m pip install .[test]
- name: Uninstall magic (linux)
if: matrix.sys.os == 'ubuntu-latest'
run: |
sudo apt remove -y file libmagic-mgc libmagic1
- name: Test package
run: |
python -m pytest -ra
python -m pytest -ra -m 'isolate' tests/test_import.py