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.os }},${{ matrix.result }}] runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-18.04, windows-latest, macos-latest] 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: Install Visual C++ for Python 2.7 if: runner.os == 'Windows' run: | choco install vcpython27 -f -y - name: Generate sample project shell: bash 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 shell: bash 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' }}