@@ -3,154 +3,45 @@ name: push
33on :
44 push :
55 schedule :
6- - cron : " 0 8 * * 1" # Mondays at 8am
6+ - cron : " 0 8 * * 1" # mondays at 8am
77
88jobs :
9- build : # -----------------------------------------------------------------------------
9+ lint :
1010 runs-on : ubuntu-latest
1111
12- strategy :
13- matrix :
14- python-version : ["3.8", "3.x"]
15- name : build-v${{matrix.python-version}}
16-
1712 steps :
18- - name : Checking out Git Commit
19- uses : actions/checkout@v2
20-
21- - name : Installing Python
22- uses : actions/setup-python@v2
23- with :
24- python-version : ${{matrix.python-version}}
25- cache : pip
26- cache-dependency-path : pyproject.toml
27-
28- - uses : actions/cache@v2
29- with :
30- path : ${{ env.pythonLocation }}
31- key : ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('MANIFEST.in') }}-${{ hashFiles('pyproject.toml') }}
13+ - uses : actions/checkout@v3
14+ - uses : ./.github/actions/lint
3215
33- - name : Installing dependencies
34- run : pip install -U -r requirements.txt -r requirements-test.txt -r requirements-dev.txt
35-
36- - name : Attempting build
37- run : python -m build --wheel --no-isolation
38-
39- lint : # ------------------------------------------------------------------------------
16+ test :
4017 runs-on : ubuntu-latest
41- needs : build
4218
4319 steps :
44- - name : Checking out Git Commit
45- uses : actions/checkout@v2
46-
47- - name : Installing Python
48- uses : actions/setup-python@v2
49- with :
50- python-version : 3.x
51- cache : pip
52- cache-dependency-path : pyproject.toml
20+ - uses : actions/checkout@v3
21+ - uses : ./.github/actions/test
5322
54- - uses : actions/cache@v2
55- with :
56- path : ${{ env.pythonLocation }}
57- key : ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-text.txt') }}-${{ hashFiles('MANIFEST.in') }}
58-
59- - name : Linting with black
60- run : black --check mnamer tests
61-
62- - name : Linting isort
63- run : isort --check-only mnamer tests
64-
65- - name : Linting mypy
66- run : mypy mnamer
67-
68- test : # ------------------------------------------------------------------------------
23+ publish :
6924 runs-on : ubuntu-latest
70- needs : build
71-
72- strategy :
73- matrix :
74- python-version : ["8", "3.x"]
75- name : test-v${{matrix.python-version}}
7625
77- steps :
78- - name : Checking out Git Commit
79- uses : actions/checkout@v2
80-
81- - name : Installing Python
82- uses : actions/setup-python@v2
83- with :
84- python-version : ${{matrix.python-version}}
85- cache : pip
86- cache-dependency-path : pyproject.toml
87-
88- - uses : actions/cache@v2
89- with :
90- path : ${{ env.pythonLocation }}
91- key : ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-text.txt') }}-${{ hashFiles('MANIFEST.in') }}
92- - name : Running Local Unit Tests
93- run : >-
94- python -m pytest
95- -m local
96- --durations=10
97- --cov=./
98- --cov-append
99- --cov-report=term-missing
100- --cov-report=xml
101-
102- - name : Running Network Unit Tests
103- run : >-
104- python -m pytest
105- -m network
106- --reruns 3
107- --durations=10
108- --cov=./
109- --cov-append
110- --cov-report=term-missing
111- --cov-report=xml
26+ if : >-
27+ success()
28+ && github.event_name == 'push'
29+ && github.ref == 'refs/heads/main'
11230
113- - name : Running End to End Tests
114- run : >-
115- python -m pytest
116- -m e2e
117- --reruns 3
118- --durations=10
119- --cov=./
120- --cov-append
121- --cov-report=term-missing
122- --cov-report=xml
123-
124- - name : Reporting Coverage Statistics
125- if : >
126- success()
127- && github.event_name == 'push'
128- && github.ref == 'refs/heads/master'
129- && matrix['python-version'] == '3.x'
130- uses : codecov/codecov-action@v1
131-
132- publish : # ---------------------------------------------------------------------------
133- runs-on : ubuntu-latest
134- if : startsWith(github.ref, 'refs/tags')
13531 needs :
136- - build
13732 - lint
13833 - test
13934
14035 steps :
141- - name : Checking out Git Commit
142- uses : actions/checkout@v2
143-
144- - name : Installing Python
145- uses : actions/setup-python@v2
146- with :
147- python-version : 3.8
36+ - uses : actions/checkout@v3
37+ with : { fetch-depth: 0 } # required for setuptools_scm to detect git tags
38+ - uses : ./.github/actions/init
14839
149- - name : Installing Requirements
150- run : pip install -U -r requirements.txt -r -r requirements-dev.txt
40+ - name : Building
41+ run : python3 -m build --sdist --wheel --no-isolation
15142
152- - name : Building wheel and source distribution
153- run : python -m build --sdist --wheel
43+ - name : Reporting Version
44+ run : python3 -m mnamer --version
15445
15546 - name : Uploading to PyPI
15647 run : >-
0 commit comments