@@ -5,10 +5,10 @@ name: Python package
55
66on :
77 push :
8- branches : [ "main" ]
8+ branches : ["main"]
99 paths-ignore :
10- - " codeforlife/version.py"
11- - " CHANGELOG.md"
10+ - " codeforlife/version.py"
11+ - " CHANGELOG.md"
1212
1313jobs :
1414 test :
@@ -19,65 +19,65 @@ jobs:
1919 matrix :
2020 python-version : ["3.7"]
2121 steps :
22- - uses : actions/checkout@v3
22+ - uses : actions/checkout@v3
23+
24+ - name : Set up Python ${{ matrix.python-version }}
25+ uses : actions/setup-python@v4
26+ with :
27+ python-version : ${{ matrix.python-version }}
28+
29+ - name : Install Python Packages
30+ run : |
31+ python -m pip install --upgrade pip
32+ python -m pip install pipenv
33+ pipenv install --dev
34+
35+ - name : Check Code Format
36+ run : if ! pipenv run black --check .; then exit 1; fi
37+
38+ # TODO: assert code coverage target.
39+ - name : Test Code Units
40+ run : pipenv run pytest tests
2341
24- - name : Set up Python ${{ matrix.python-version }}
25- uses : actions/setup-python@v4
26- with :
27- python-version : ${{ matrix.python-version }}
28-
29- - name : Install Python Packages
30- run : |
31- python -m pip install --upgrade pip
32- python -m pip install pipenv
33- pipenv install --dev
34-
35- - name : Check Code Format
36- run : if ! pipenv run black --check .; then exit 1; fi
37-
38- # TODO: assert code coverage target.
39- - name : Test Code Units
40- run : pipenv run pytest tests
41-
4242 release :
4343 name : Publish Release
4444 concurrency : release
4545 runs-on : ubuntu-latest
4646 needs : [test]
4747 steps :
48- - uses : actions/checkout@v3
49- with :
50- token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
51- fetch-depth : 0
52-
53- - name : Set up Python 3.7
54- uses : actions/setup-python@v4
55- with :
56- python-version : ' 3.7'
57-
58- - name : Install Dependencies
59- run : |
60- python -m pip install --upgrade pip
61- # pipenv-setup requires downgraded vistir: https://github.com/Madoshakalaka/pipenv-setup/issues/138
62- python -m pip install python-semantic-release~=7.33 pipenv-setup[black]==3.2.0 vistir==0.6.1
63-
64- - name : Setup Git
65- run : |
66- git config --local user.name github-actions
67- git config --local user.email [email protected] 48+ - uses : actions/checkout@v3
49+ with :
50+ token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
51+ fetch-depth : 0
52+
53+ - name : Set up Python 3.7
54+ uses : actions/setup-python@v4
55+ with :
56+ python-version : " 3.7"
57+
58+ - name : Install Dependencies
59+ run : |
60+ python -m pip install --upgrade pip
61+ # pipenv-setup requires downgraded vistir: https://github.com/Madoshakalaka/pipenv-setup/issues/138
62+ python -m pip install python-semantic-release~=7.33 pipenv-setup[black]==3.2.0 vistir==0.6.1
63+
64+ - name : Setup Git
65+ run : |
66+ git config --local user.name github-actions
67+ git config --local user.email [email protected] 68+
69+ - name : Sync Setup Dependencies
70+ run : |
71+ pipenv-setup sync
72+ git add setup.py
6873
69- - name : Sync Setup Dependencies
70- run : |
71- pipenv-setup sync
72- git add setup.py
74+ # Only commit and push if there are differences.
75+ if ! git diff --staged --quiet; then
76+ git commit -m "ci[setup]: sync dependencies [skip ci]"
77+ git push
78+ fi
7379
74- # Only commit and push if there are differences.
75- if ! git diff --staged --quiet; then
76- git commit -m "ci[setup]: sync dependencies [skip ci]"
77- git push
78- fi
79-
80- - name : Publish Semantic Release
81- env :
82- GH_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
83- run : semantic-release publish --verbosity=INFO
80+ - name : Publish Semantic Release
81+ env :
82+ GH_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
83+ run : semantic-release publish --verbosity=INFO
0 commit comments