84 lines
2.0 KiB
YAML
84 lines
2.0 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
workflow_dispatch:
|
|
# allow manual runs on branches without a PR
|
|
|
|
jobs:
|
|
pre-commit:
|
|
name: Pre-commit checks (mypy, flake8, etc.)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
- uses: pre-commit/action@v2.0.3
|
|
|
|
test:
|
|
name: Test cibuildwheel on ${{ matrix.os }}
|
|
needs: pre-commit
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
python_version: ['3.7']
|
|
timeout-minutes: 180
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
name: Install Python ${{ matrix.python_version }}
|
|
with:
|
|
python-version: ${{ matrix.python_version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install -e ".[dev]"
|
|
|
|
- name: Sample build
|
|
if: "contains(github.event.pull_request.labels.*.name, 'CI: Sample build')"
|
|
run: |
|
|
python bin/sample_build.py
|
|
|
|
- name: Get some sample wheels
|
|
run: |
|
|
python -m test.test_projects test.test_0_basic.basic_project sample_proj
|
|
cibuildwheel --output-dir wheelhouse sample_proj
|
|
env:
|
|
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: sample_wheels
|
|
path: wheelhouse
|
|
|
|
- name: Test cibuildwheel
|
|
run: |
|
|
python ./bin/run_tests.py
|
|
|
|
test-emulated:
|
|
name: Test emulated cibuildwheel using qemu
|
|
needs: pre-commit
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 180
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install -r requirements-dev.txt
|
|
|
|
- name: Set up QEMU
|
|
id: qemu
|
|
uses: docker/setup-qemu-action@v1
|
|
with:
|
|
platforms: all
|
|
|
|
- name: Run the emulation tests
|
|
run: |
|
|
pytest --run-emulation test/test_emulation.py
|