Skip to content

Commit a9aa8e6

Browse files
committed
use maturin actions
1 parent 0175bc1 commit a9aa8e6

File tree

2 files changed

+39
-23
lines changed

2 files changed

+39
-23
lines changed

.github/workflows/cross_platform_tests.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ on:
77
branches: [ main, master ]
88
workflow_dispatch: # Allows manual triggering
99

10+
# Add this section to control notification behavior
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
# Explicitly disable all notifications
16+
env:
17+
GITHUB_ACTIONS_SKIP_NOTIFICATIONS: true
18+
ACTIONS_STEP_DEBUG: false
19+
GITHUB_ACTIONS_NOTIFICATIONS: false
20+
1021
jobs:
1122
build_and_test:
1223
name: Build and test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
@@ -26,30 +37,38 @@ jobs:
2637
uses: actions/setup-python@v4
2738
with:
2839
python-version: ${{ matrix.python-version }}
29-
30-
- name: Install Rust
31-
uses: dtolnay/rust-toolchain@stable
3240

33-
- name: Install dependencies
41+
- name: Install dependencies for testing
3442
run: |
3543
python -m pip install --upgrade pip
36-
pip install maturin>=1.8.3 pytest pytest-benchmark
44+
pip install pytest pytest-benchmark
3745
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
38-
shell: bash
3946
4047
- name: Install c2pa-python for benchmarking
4148
run: pip install c2pa-python
4249
continue-on-error: true # Continue even if c2pa-python install fails
4350

44-
- name: Build library (development mode)
45-
run: maturin develop --release
51+
- name: Build package with maturin (development mode)
52+
uses: PyO3/maturin-action@v1
53+
with:
54+
target: ${{ matrix.os == 'windows-latest' && 'x64' || 'x86_64' }}
55+
args: --release develop
56+
sccache: 'true'
57+
python-version: ${{ matrix.python-version }}
58+
working-directory: .
4659

4760
- name: Run tests
4861
run: python run_tests.py
4962
continue-on-error: true # Continue even if tests fail to get wheels
5063

5164
- name: Build wheel
52-
run: maturin build --release
65+
uses: PyO3/maturin-action@v1
66+
with:
67+
target: ${{ matrix.os == 'windows-latest' && 'x64' || 'x86_64' }}
68+
args: --release
69+
sccache: 'true'
70+
python-version: ${{ matrix.python-version }}
71+
working-directory: .
5372

5473
- name: Upload wheels
5574
uses: actions/upload-artifact@v4

.github/workflows/release.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
tags:
66
- 'v*' # Run when a tag starting with 'v' is pushed
77

8+
# Disable notifications
9+
env:
10+
GITHUB_ACTIONS_SKIP_NOTIFICATIONS: true
11+
ACTIONS_STEP_DEBUG: false
12+
GITHUB_ACTIONS_NOTIFICATIONS: false
13+
814
jobs:
915
build_wheels:
1016
name: Build wheels on ${{ matrix.os }}
@@ -14,29 +20,20 @@ jobs:
1420
matrix:
1521
os: [ubuntu-latest, windows-latest, macos-latest]
1622
python-version: ['3.10', '3.11']
17-
# Add specific exclusions here if needed
18-
# exclude:
19-
# - os: macos-latest
20-
# python-version: '3.12'
2123

2224
steps:
2325
- uses: actions/checkout@v4
2426
with:
2527
submodules: recursive
2628

27-
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v4
29+
- name: Build wheels
30+
uses: PyO3/maturin-action@v1
2931
with:
32+
target: ${{ matrix.os == 'windows-latest' && 'x64' || 'x86_64' }}
33+
args: --release --strip
34+
sccache: 'true'
3035
python-version: ${{ matrix.python-version }}
3136

32-
- name: Install Rust
33-
uses: dtolnay/rust-toolchain@stable
34-
35-
- name: Build wheels
36-
run: |
37-
pip install maturin>=1.8.3
38-
maturin build --release --strip
39-
4037
- name: Upload wheels
4138
uses: actions/upload-artifact@v4
4239
with:

0 commit comments

Comments
 (0)