Repository: pypa/cibuildwheel

Issue:
Support for GitHub actions
https://github.com/features/actions

(which is still in closed beta, but filing this anyhow since hopefully it's in the cards?).


Discussion:
Yep, this is very interesting for us, since it's Linux/mac/windows and right here on github. Investigations and PRs welcome!

Resolving patch:
diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py
--- 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'):


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,29 @@
+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]
+        python_version: ['3.7']
+    steps:
+    - uses: actions/checkout@v1
+    - uses: actions/setup-python@v1
+      name: Install Python ${{ matrix.python_version }}
+      with:
+        python-version: ${{ matrix.python_version }}
+
+    - 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/unit_test/main_tests/main_platform_test.py b/unit_test/main_tests/main_platform_test.py
--- a/unit_test/main_tests/main_platform_test.py
+++ b/unit_test/main_tests/main_platform_test.py
@@ -11,6 +11,7 @@ def test_unknown_platform_non_ci(monkeypatch, capsys):
     monkeypatch.delenv('CI', raising=False)
     monkeypatch.delenv('BITRISE_BUILD_NUMBER', raising=False)
     monkeypatch.delenv('AZURE_HTTP_USER_AGENT', raising=False)
+    monkeypatch.delenv('GITHUB_WORKFLOW', raising=False)
 
     with pytest.raises(SystemExit) as exit:
         main()