@@ -2,7 +2,15 @@ name: Code CI
22
33on :
44 push :
5+ branches :
6+ - master
7+ - main
8+ tags :
9+ - " *"
510 pull_request :
11+ schedule :
12+ # Run every Monday at 8am
13+ - cron : ' 0 8 * * MON'
614
715jobs :
816 lint :
@@ -30,15 +38,18 @@ jobs:
3038 python : [cp36, cp37, cp38, cp39]
3139
3240 include :
33- # Put coverage in the project directory for mac
41+ # Put coverage and results files in the project directory for mac
3442 - os : macos-latest
3543 cov_file : " {project}/dist/coverage.xml"
44+ results_file : " {project}/dist/pytest-results.xml"
3645 # And for windows
3746 - os : windows-latest
3847 cov_file : " {project}/dist/coverage.xml"
39- # But put coverage in the output dir mounted in docker for linux
48+ results_file : " {project}/dist/pytest-results.xml"
49+ # But put coverage and results files in the output dir mounted in docker for linux
4050 - os : ubuntu-latest
4151 cov_file : /output/coverage.xml
52+ results_file : /output/pytest-results.xml
4253 # Build an sdist on linux so it has the right line endings
4354 - os : ubuntu-latest
4455 sdist : true
6071 python-version : " 3.7"
6172
6273 - name : Install Python Dependencies
63- run : pip install build cibuildwheel==1.* # The 2.* releases dropped Python2 support.
74+ # Pin cibuildwheel due to https://github.com/pypa/cibuildwheel/issues/962
75+ run : pip install build cibuildwheel>=2.3.1
6476
6577 - name : Build Sdist
6678 if : matrix.sdist
@@ -69,14 +81,17 @@ jobs:
6981 - name : Build Wheel
7082 run : cibuildwheel --output-dir dist
7183 env :
84+ # Force old behaviour of pip - see https://github.com/pypa/cibuildwheel/issues/962
85+ CIBW_ENVIRONMENT : PIP_USE_DEPRECATED=out-of-tree-build
7286 CIBW_BUILD : ${{ matrix.python }}*64
7387 CIBW_TEST_EXTRAS : dev
74- CIBW_TEST_COMMAND : pytest {project}/tests --cov-report xml:${{ matrix.cov_file }}
88+ CIBW_TEST_COMMAND : pytest {project}/tests --cov-report xml:${{ matrix.cov_file }} --junit-xml=${{ matrix.results_file }}
7589 # Disable auditwheel as it isn't compatible with setuptools_dso approach
7690 # https://github.com/mdavidsaver/setuptools_dso/issues/17
7791 CIBW_REPAIR_WHEEL_COMMAND : " "
7892 CIBW_MANYLINUX_X86_64_IMAGE : manylinux2014
7993 CIBW_ENVIRONMENT_LINUX : SETUPTOOLS_DSO_PLAT_NAME=manylinux2014_x86_64
94+ CIBW_SKIP : " *-musllinux*" # epicscorelibs doesn't build on musllinux platforms
8095
8196 - name : Upload Wheel and Sdist
8297 uses : actions/upload-artifact@v2
@@ -90,6 +105,30 @@ jobs:
90105 name : ${{ matrix.os }}/${{ matrix.python }}
91106 directory : dist
92107
108+ - name : Upload Unit Test Results
109+ if : always()
110+ uses : actions/upload-artifact@v2
111+ with :
112+ name : Unit Test Results (${{ matrix.os }}-${{ matrix.python }})
113+ path : dist/pytest-results.xml
114+
115+ publish-test-results :
116+ name : Publish Unit Tests Results
117+ needs : build
118+ runs-on : ubuntu-latest
119+ if : always()
120+
121+ steps :
122+ - name : Download Artifacts
123+ uses : actions/download-artifact@v2
124+ with :
125+ path : artifacts
126+
127+ - name : Publish Unit Test Results
128+ uses : EnricoMi/publish-unit-test-result-action@v1
129+ with :
130+ files : artifacts/**/*.xml
131+
93132 release :
94133 needs : [build]
95134 runs-on : ubuntu-latest
@@ -115,4 +154,4 @@ jobs:
115154 env :
116155 TWINE_USERNAME : __token__
117156 TWINE_PASSWORD : ${{ secrets.pypi_token }}
118- run : pipx run twine upload dist/*
157+ run : pipx run twine upload dist/*
0 commit comments