Skip to content

Commit ed0b97a

Browse files
Filter out draft PRs from normal ci workflow
1 parent ebb3339 commit ed0b97a

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Continuous Integration Tests Draft PR (pytest)
2+
# This duplicate ci workflow is required so the badge in the README.md is not effected by draft PRs
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
if: github.event.pull_request.draft == true
11+
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
16+
python-version: ["3.9"]
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python using Miniconda
20+
uses: conda-incubator/setup-miniconda@v2
21+
with:
22+
auto-update-conda: true
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install package and dependencies
25+
run: |
26+
python --version
27+
pip install -e .
28+
pip install -e .[test]
29+
pip install pytest pytest-cov
30+
shell: bash -l {0}
31+
- name: Test with pytest
32+
run: |
33+
pytest --cov=causal_testing --cov-report=xml
34+
shell: bash -l {0}
35+
- name: "Upload coverage to Codecov"
36+
uses: codecov/codecov-action@v2
37+
with:
38+
fail_ci_if_error: true
39+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/ci-tests.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ on:
44
pull_request:
55
branches:
66
- main
7+
types:
8+
- opened
9+
- synchronize
10+
- reopened
11+
- ready_for_review
712

813
jobs:
914
build:
15+
if: github.event.pull_request.draft == false # Filter out draft PRs
1016
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
1117
runs-on: ${{ matrix.os }}
1218
strategy:

0 commit comments

Comments
 (0)