diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..a69622126 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: [push, pull_request] + +jobs: + test: + name: Test cibuildwheel on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + name: Install Python ${{ matrix.python_version }} + 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: startsWith(matrix.os, 'windows') + run: | + choco install vcpython27 -f -y + - name: Test cibuildwheel + run: | + python ./bin/run_tests.py diff --git a/README.md b/README.md index 021fcdc3c..f9267aab0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ cibuildwheel Python wheels are great. Building them across **Mac, Linux, Windows**, on **multiple versions of Python**, is not. -`cibuildwheel` is here to help. `cibuildwheel` runs on your CI server - currently it supports Azure Pipelines, Travis CI, AppVeyor, and CircleCI - and it builds and tests your wheels across all of your platforms. +`cibuildwheel` is here to help. `cibuildwheel` runs on your CI server - currently it supports Azure Pipelines, Travis CI, AppVeyor, GitHub Actions and CircleCI - and it builds and tests your wheels across all of your platforms. What does it do? @@ -35,13 +35,14 @@ What does it do? Usage ----- -`cibuildwheel` currently works on **Travis CI**, **Azure Pipelines** and **AppVeyor** to build wheels for all three supported platforms (Linux, macOS, Windows). On **CircleCI** Linux and macOS wheels can be built. +`cibuildwheel` currently works on **Travis CI**, **Azure Pipelines**, **AppVeyor** and **GitHub Actions** to build wheels for all three supported platforms (Linux, macOS, Windows). On **CircleCI** Linux and macOS wheels can be built. | | Linux | macOS | Windows | |-----------------|-------|-------|---------| | Azure Pipelines | ✅ | ✅ | ✅ | | Travis CI | ✅ | ✅ | ✅ | | AppVeyor | ✅ | ✅ | ✅ | +| GitHub Actions | ✅ | ✅ | ✅ | | CircleCI | ✅ | ✅ | | `cibuildwheel` is not intended to run on your development machine. Because it uses system Python from Python.org it will try to install packages globally - not what you expect from a build tool! Instead, isolated CI services like Travis CI, CircleCI, Azure Pipelines and AppVeyor are ideal. diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index aa7f6587d..41475c2ba 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -77,12 +77,12 @@ def main(): if args.platform != 'auto': platform = args.platform else: - ci = strtobool(os.environ.get('CI', 'false')) or 'BITRISE_BUILD_NUMBER' in os.environ or 'AZURE_HTTP_USER_AGENT' in os.environ + ci = strtobool(os.environ.get('CI', 'false')) or 'BITRISE_BUILD_NUMBER' in os.environ or 'AZURE_HTTP_USER_AGENT' in os.environ or 'GITHUB_WORKFLOW' in os.environ if not ci: print('cibuildwheel: Unable to detect platform. cibuildwheel should run on your CI server, ' - 'Travis CI, AppVeyor, Azure Pipelines and CircleCI are supported. You can run on your ' - 'development machine or other CI providers using the --platform argument. Check --help ' - 'output for more information.', + 'Travis CI, AppVeyor, Azure Pipelines, GitHub Actions and CircleCI are supported. You ' + 'can run on your development machine or other CI providers using the --platform argument. ' + 'Check --help output for more information.', file=sys.stderr) exit(2) if sys.platform.startswith('linux'): diff --git a/docs/setup.md b/docs/setup.md index 9f74269b5..84a9b81c8 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -65,6 +65,19 @@ AppVeyor will store the built wheels for you - you can access them from the proj For more info on this config file, check out the [docs](https://www.appveyor.com/docs/). +# GitHub Actions [linux/mac/windows] {: #github-actions} + +Using GitHub Actions, you can build all three platforms on the same service. Create a `./github/workflows/build.yml` file in your repo. + +> build.yml +```yaml +{% include "../examples/github-minimal.yml" %} +``` + +Commit this file, enable building of your repo on GitHub Actions, and push. + +For more info on this file, check out the [docs](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions). + > ⚠️ Got an error? Check the [FAQ](faq.md).