Skip to content

Commit

Permalink
minor CI fixes (#117)
Browse files Browse the repository at this point in the history
* GitHub-Actions: refactor trigger events; only build master/develop and all PRs to develop (master only gets PR from develop)
* GitHub-Actions: test.pypi from master and develop
* GitHub-Actions: pin cibuildwheel version
  • Loading branch information
MuellerSeb authored Dec 3, 2020
1 parent 1a1947a commit b56a1b3
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: Continuous Integration

on: [push, pull_request]
on:
push:
branches:
- "master"
- "develop"
tags:
- "*"
pull_request:
branches:
- "develop"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
# needed by coveralls
Expand All @@ -10,15 +21,10 @@ env:
CIBW_TEST_REQUIRES: "pytest"
CIBW_TEST_COMMAND: "pytest -v {project}/tests"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build_wheels:
name: wheels on ${{matrix.os}}
runs-on: ${{matrix.os}}
# only run on internal push's or external PRs, not on internal PRs
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
Expand All @@ -37,7 +43,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cibuildwheel>=1.7.0
pip install cibuildwheel==1.7.0
- name: Build wheels
run: |
python -m cibuildwheel --output-dir dist
Expand All @@ -49,8 +55,6 @@ jobs:
build_sdist:
name: sdist on ${{matrix.os}} with py ${{ matrix.python-version }}
runs-on: ${{matrix.os}}
# only run on internal push's or external PRs, not on internal PRs
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -92,8 +96,6 @@ jobs:
upload_to_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# only run on internal push's or external PRs, not on internal PRs
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

steps:
- uses: actions/download-artifact@v2
Expand All @@ -103,7 +105,7 @@ jobs:

- name: Publish to Test PyPI
# only if working on develop
if: github.ref == 'refs/heads/develop'
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
Expand Down

0 comments on commit b56a1b3

Please sign in to comment.