54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Sample build
|
|
|
|
on:
|
|
push: {}
|
|
pull_request:
|
|
branches:
|
|
# PRs from branches on the origin repo get a build from the 'push'
|
|
# trigger. So the pull_request trigger is limited to fork branches
|
|
- '**:**'
|
|
|
|
jobs:
|
|
build_wheels:
|
|
name: Sample build [${{ matrix.result }}]
|
|
runs-on: ubuntu-18.04
|
|
strategy:
|
|
matrix:
|
|
result: [success, failure]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
name: Install Python
|
|
with:
|
|
python-version: '3.7'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install -r requirements-dev.txt
|
|
|
|
- name: Generate sample project
|
|
run: |
|
|
if $should_fail; then
|
|
python -m test.test_projects test.test_testing.project_with_a_failing_test sample_project
|
|
else
|
|
python -m test.test_projects test.test_testing.project_with_a_test sample_project
|
|
fi
|
|
env:
|
|
should_fail: ${{ matrix.result == 'failure' }}
|
|
|
|
- name: Build & test wheels
|
|
run: |
|
|
cd sample_project
|
|
if $should_fail; then
|
|
# prefix with ! to expect failure
|
|
! python -m cibuildwheel --output-dir wheelhouse
|
|
else
|
|
python -m cibuildwheel --output-dir wheelhouse
|
|
fi
|
|
env:
|
|
CIBW_TEST_COMMAND: nosetests {project}/test
|
|
CIBW_TEST_REQUIRES: nose
|
|
should_fail: ${{ matrix.result == 'failure' }}
|