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
810jobs :
911 build :
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
2528 python -m pip install --upgrade pip
2629 python -m pip install pytest
2730 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
2832 - name : Lint with pylint
2933 run : |
3034 pylint pyformlang || true
@@ -34,20 +38,19 @@ jobs:
3438 - name : Test with pytest
3539 run : |
3640 pytest --showlocals -v pyformlang
41+
3742 - name : Build coverage file
38- if : ${{ matrix.python-version == '3.8'}}
3943 run : |
4044 pytest pyformlang --junitxml=pytest.xml --cov=pyformlang | tee ./pytest-coverage.txt
41- - name : Pytest coverage comment
42- if : ${{ matrix.python-version == '3.8'}}
45+ - name : Make coverage comment
4346 uses : MishaKav/pytest-coverage-comment@main
4447 id : coverageComment
4548 with :
4649 pytest-coverage-path : ./pytest-coverage.txt
4750 junitxml-path : ./pytest.xml
4851 default-branch : master
52+
4953 - name : Create coverage Badge
50- if : ${{ github.ref_name == 'master' && matrix.python-version == '3.8'}}
5154 uses : schneegans/dynamic-badges-action@v1.0.0
5255 with :
5356 auth : ${{ secrets.GIST_SECRET }}
0 commit comments