-
Notifications
You must be signed in to change notification settings - Fork 18
97 lines (85 loc) · 2.59 KB
/
ci.yml
File metadata and controls
97 lines (85 loc) · 2.59 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
95
96
97
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Determine runtime identifier
id: rid
shell: bash
run: |
case "${{ runner.os }}" in
Linux) echo "rid=linux-x64" >> "$GITHUB_OUTPUT" ;;
Windows) echo "rid=win-x64" >> "$GITHUB_OUTPUT" ;;
macOS) echo "rid=osx-arm64" >> "$GITHUB_OUTPUT" ;;
esac
- name: Build engine binaries for this platform
run: python build_differ.py ${{ steps.rid.outputs.rid }}
- name: Install packages (editable)
run: pip install -e packages/core -e packages/ooxmlpowertools -e packages/docxodus pytest
- name: Run tests
run: python -m pytest tests/ -v
build-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install build twine
- name: Build core sdist + wheel
run: python -m build packages/core --outdir dist
- name: Check distributions
run: twine check dist/*
build-engine-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, rids: "linux-x64 linux-arm64" }
- { os: windows-latest, rids: "win-x64 win-arm64" }
- { os: macos-latest, rids: "osx-x64 osx-arm64" }
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- run: pip install build hatchling twine
- name: Build per-platform engine wheels
shell: bash
run: |
for rid in ${{ matrix.rids }}; do
python build_differ.py "$rid"
python -m build --wheel --no-isolation packages/ooxmlpowertools --outdir dist
python -m build --wheel --no-isolation packages/docxodus --outdir dist
done
- name: Check wheels
run: twine check dist/*