Skip to content

Commit

Permalink
Split workflows on push and pull request
Browse files Browse the repository at this point in the history
This patch duplicates the workflows so that they do not run in double
for no reason. This saves some CO2 in the atmosphere.
  • Loading branch information
mristin committed Mar 16, 2021
1 parent 956e5a5 commit 647ecfe
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci_with_osx_on_pull_request.yml
@@ -0,0 +1,22 @@
name: Continuous Integration on Pull Request - OSX

on: [pull_request]

jobs:
tests:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x

- name: Install Dependencies
run: |
pip3 install .[dev]
- name: Check
run: |
python precommit.py
@@ -1,6 +1,11 @@
name: Continuous Integration - OSX

on: [push, pull_request]
on:
push:
branches:
- master
- main


jobs:
tests:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/ci_with_ubuntu_on_pull_request.yml
@@ -0,0 +1,47 @@
name: Continuous Integration on Pull Request - Ubuntu

on: [pull_request]

jobs:
Execute:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x

- name: Install Dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install --upgrade coveralls
pip3 install .[dev]
- name: Check
run: |
python precommit.py
- name: Upload Coverage
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true

Finish-Coveralls:
name: Finish Coveralls
needs: Execute
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finish Coveralls
run: |
pip3 install --upgrade coveralls
coveralls --finish --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,6 +1,10 @@
name: Continuous Integration - Ubuntu

on: [push, pull_request]
on:
push:
branches:
- master
- main

jobs:
Execute:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/ci_with_windows_on_pull_request.yml
@@ -0,0 +1,22 @@
name: Continuous Integration on Pull Request - Windows

on: [pull_request]

jobs:
tests:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x

- name: Install Dependencies
run: |
pip3 install .[dev]
- name: Check
run: |
python precommit.py
@@ -1,6 +1,10 @@
name: Continuous Integration - Windows

on: [push, pull_request]
on:
push:
branches:
- master
- main

jobs:
tests:
Expand Down

0 comments on commit 647ecfe

Please sign in to comment.