Skip to content

Commit 7d7b600

Browse files
authored
Merge pull request #8 from FormalLanguageConstrainedPathQuerying/split_ci
Split CI into separate workflows
2 parents 68ef594 + 1dd40c4 commit 7d7b600

File tree

3 files changed

+100
-11
lines changed

3 files changed

+100
-11
lines changed

.github/workflows/ci_extra.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow is for any branch. It runs additional tests for several python versions.
2+
3+
name: Build extra
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.9", "3.10"]
15+
16+
steps:
17+
18+
- uses: actions/checkout@v3
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r requirements.txt
27+
28+
- name: Lint with pylint
29+
run: |
30+
pylint pyformlang || true
31+
- name: Lint with pycodestyle
32+
run: |
33+
pycodestyle pyformlang || true
34+
- name: Test with pytest
35+
run: |
36+
pytest --showlocals -v pyformlang

.github/workflows/ci_feature.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow is for feature branches. It sets up python, lints with several analyzers,
2+
# runs tests, collects test coverage and makes a coverage comment.
3+
4+
name: Build feature
5+
6+
on:
7+
push:
8+
branches-ignore: "master"
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.8"]
19+
20+
steps:
21+
22+
- uses: actions/checkout@v3
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements.txt
31+
32+
- name: Lint with pylint
33+
run: |
34+
pylint pyformlang || true
35+
- name: Lint with pycodestyle
36+
run: |
37+
pycodestyle pyformlang || true
38+
- name: Test with pytest
39+
run: |
40+
pytest --showlocals -v pyformlang
41+
42+
- name: Build coverage file
43+
run: |
44+
pytest pyformlang --junitxml=pytest.xml --cov=pyformlang | tee ./pytest-coverage.txt
45+
- name: Make coverage comment
46+
uses: MishaKav/pytest-coverage-comment@main
47+
id: coverageComment
48+
with:
49+
pytest-coverage-path: ./pytest-coverage.txt
50+
junitxml-path: ./pytest.xml
51+
default-branch: master

.github/workflows/python-package.yml renamed to .github/workflows/ci_master.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1+
# This workflow is for master branch only. It sets up python, lints with several analyzers,
2+
# runs tests, collects test coverage, makes a coverage comment and creates a coverage badge.
33

4-
name: Python package
4+
name: Build master
55

6-
on: [push, pull_request]
6+
on:
7+
push:
8+
branches: "master"
79

810
jobs:
911
build:
@@ -12,9 +14,10 @@ jobs:
1214
strategy:
1315
fail-fast: false
1416
matrix:
15-
python-version: ["3.8", "3.9", "3.10"]
17+
python-version: ["3.8"]
1618

1719
steps:
20+
1821
- uses: actions/checkout@v3
1922
- name: Set up Python ${{ matrix.python-version }}
2023
uses: actions/setup-python@v3
@@ -23,8 +26,8 @@ jobs:
2326
- name: Install dependencies
2427
run: |
2528
python -m pip install --upgrade pip
26-
python -m pip install pytest
27-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
pip install -r requirements.txt
30+
2831
- name: Lint with pylint
2932
run: |
3033
pylint pyformlang || true
@@ -34,20 +37,19 @@ jobs:
3437
- name: Test with pytest
3538
run: |
3639
pytest --showlocals -v pyformlang
40+
3741
- name: Build coverage file
38-
if: ${{ matrix.python-version == '3.8'}}
3942
run: |
4043
pytest pyformlang --junitxml=pytest.xml --cov=pyformlang | tee ./pytest-coverage.txt
41-
- name: Pytest coverage comment
42-
if: ${{ matrix.python-version == '3.8'}}
44+
- name: Make coverage comment
4345
uses: MishaKav/pytest-coverage-comment@main
4446
id: coverageComment
4547
with:
4648
pytest-coverage-path: ./pytest-coverage.txt
4749
junitxml-path: ./pytest.xml
4850
default-branch: master
51+
4952
- name: Create coverage Badge
50-
if: ${{ github.ref_name == 'master' && matrix.python-version == '3.8'}}
5153
uses: schneegans/dynamic-badges-action@v1.0.0
5254
with:
5355
auth: ${{ secrets.GIST_SECRET }}

0 commit comments

Comments
 (0)