Merge pull request #21 from JSv4/packaging-optional-engines #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/* |