Skip to content

Commit 8ab0f2c

Browse files
Test PR on more platforms
1 parent 939013f commit 8ab0f2c

File tree

1 file changed

+80
-76
lines changed

1 file changed

+80
-76
lines changed

.github/workflows/code.yml

Lines changed: 80 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -49,79 +49,79 @@ jobs:
4949
# name: dist
5050
# path: dist/*
5151

52-
# build:
53-
# strategy:
54-
# fail-fast: false
55-
# matrix:
56-
# os: [ubuntu-latest, windows-latest, macos-13]
57-
# python: [cp37, cp38, cp39, cp310, cp311, cp312]
58-
52+
build:
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
os: [ubuntu-latest, windows-latest, macos-13]
57+
python: [cp37, cp38, cp39, cp310, cp311, cp312]
58+
59+
60+
include:
61+
# Put coverage and results files in the project directory for mac
62+
- os: macos-13
63+
cov_file: "{project}/dist/coverage.xml"
64+
results_file: "{project}/dist/pytest-results.xml"
65+
# And for windows
66+
- os: windows-latest
67+
cov_file: "{project}/dist/coverage.xml"
68+
results_file: "{project}/dist/pytest-results.xml"
69+
# But put coverage and results files in the output dir mounted in docker for linux
70+
- os: ubuntu-latest
71+
cov_file: /output/coverage.xml
72+
results_file: /output/pytest-results.xml
73+
74+
name: build/${{ matrix.os }}/${{ matrix.python }}
75+
runs-on: ${{ matrix.os }}
5976

60-
# include:
61-
# # Put coverage and results files in the project directory for mac
62-
# - os: macos-13
63-
# cov_file: "{project}/dist/coverage.xml"
64-
# results_file: "{project}/dist/pytest-results.xml"
65-
# # And for windows
66-
# - os: windows-latest
67-
# cov_file: "{project}/dist/coverage.xml"
68-
# results_file: "{project}/dist/pytest-results.xml"
69-
# # But put coverage and results files in the output dir mounted in docker for linux
70-
# - os: ubuntu-latest
71-
# cov_file: /output/coverage.xml
72-
# results_file: /output/pytest-results.xml
73-
74-
# name: build/${{ matrix.os }}/${{ matrix.python }}
75-
# runs-on: ${{ matrix.os }}
76-
77-
# steps:
78-
# - name: Checkout Source
79-
# uses: actions/checkout@v4
80-
# with:
81-
# # require history to get back to last tag for version number of branches
82-
# fetch-depth: 0
83-
# submodules: true
84-
85-
# - name: Install Python
86-
# uses: actions/setup-python@v4
87-
# with:
88-
# python-version: "3.12"
77+
steps:
78+
- name: Checkout Source
79+
uses: actions/checkout@v4
80+
with:
81+
# require history to get back to last tag for version number of branches
82+
fetch-depth: 0
83+
submodules: true
8984

90-
# - name: Install Python Dependencies
91-
# # cibuildwheel 3.0.0 dropped support for Python 3.7. We still want to
92-
# # support 3.7 for the time being.
93-
# run: pip install build cibuildwheel==2.23.3
85+
- name: Install Python
86+
uses: actions/setup-python@v4
87+
with:
88+
python-version: "3.12"
9489

95-
# - name: Build Wheel
96-
# run: cibuildwheel --output-dir dist
97-
# env:
98-
# CIBW_BUILD: ${{ matrix.python }}*64
99-
# CIBW_TEST_EXTRAS: dev
100-
# # Added a sleep command afterwards to let all cleanup finish; sometimes
101-
# # cibuildwheel reports it cannot clean up the temp dir used for testing,
102-
# # and fails the build. Sleeping seems to give pytest enough time to
103-
# # fully clean up.
104-
# CIBW_TEST_COMMAND: pytest {project}/tests --cov-report xml:${{ matrix.cov_file }} --junit-xml=${{ matrix.results_file }} && sleep 2
105-
# # Run with faulthandler and -s in the hope we get a stack trace on seg fault on windows...
106-
# CIBW_TEST_COMMAND_WINDOWS: python -X faulthandler -m pytest -s {project}/tests --cov-report xml:${{ matrix.cov_file }} --junit-xml=${{ matrix.results_file }}
107-
# # Disable auditwheel as it isn't compatible with setuptools_dso approach
108-
# # https://github.com/mdavidsaver/setuptools_dso/issues/17
109-
# CIBW_REPAIR_WHEEL_COMMAND: ""
110-
# CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
111-
# CIBW_ENVIRONMENT_LINUX: SETUPTOOLS_DSO_PLAT_NAME=manylinux2014_x86_64
112-
# CIBW_SKIP: "*-musllinux*" # epicscorelibs doesn't build on musllinux platforms
113-
114-
# - name: Upload Wheel
115-
# uses: actions/upload-artifact@v4
116-
# with:
117-
# name: dist-${{ matrix.os }}-${{ matrix.python }}
118-
# path: dist/softioc*
90+
- name: Install Python Dependencies
91+
# cibuildwheel 3.0.0 dropped support for Python 3.7. We still want to
92+
# support 3.7 for the time being.
93+
run: pip install build cibuildwheel==2.23.3
94+
95+
- name: Build Wheel
96+
run: cibuildwheel --output-dir dist
97+
env:
98+
CIBW_BUILD: ${{ matrix.python }}*64
99+
CIBW_TEST_EXTRAS: dev
100+
# Added a sleep command afterwards to let all cleanup finish; sometimes
101+
# cibuildwheel reports it cannot clean up the temp dir used for testing,
102+
# and fails the build. Sleeping seems to give pytest enough time to
103+
# fully clean up.
104+
CIBW_TEST_COMMAND: pytest {project}/tests --cov-report xml:${{ matrix.cov_file }} --junit-xml=${{ matrix.results_file }} && sleep 2
105+
# Run with faulthandler and -s in the hope we get a stack trace on seg fault on windows...
106+
CIBW_TEST_COMMAND_WINDOWS: python -X faulthandler -m pytest -s {project}/tests --cov-report xml:${{ matrix.cov_file }} --junit-xml=${{ matrix.results_file }}
107+
# Disable auditwheel as it isn't compatible with setuptools_dso approach
108+
# https://github.com/mdavidsaver/setuptools_dso/issues/17
109+
CIBW_REPAIR_WHEEL_COMMAND: ""
110+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
111+
CIBW_ENVIRONMENT_LINUX: SETUPTOOLS_DSO_PLAT_NAME=manylinux2014_x86_64
112+
CIBW_SKIP: "*-musllinux*" # epicscorelibs doesn't build on musllinux platforms
113+
114+
- name: Upload Wheel
115+
uses: actions/upload-artifact@v4
116+
with:
117+
name: dist-${{ matrix.os }}-${{ matrix.python }}
118+
path: dist/softioc*
119119

120-
# - name: Upload coverage to Codecov
121-
# uses: codecov/codecov-action@v4
122-
# with:
123-
# name: ${{ matrix.os }}/${{ matrix.python }}
124-
# directory: dist
120+
- name: Upload coverage to Codecov
121+
uses: codecov/codecov-action@v4
122+
with:
123+
name: ${{ matrix.os }}/${{ matrix.python }}
124+
directory: dist
125125

126126
# test-sdist:
127127
# needs: [sdist]
@@ -174,8 +174,15 @@ jobs:
174174
# Check that the master branches of various upstream dependencies are
175175
# still compatible when used together
176176
master_branch_test:
177-
# if: ${{ github.event_name == 'schedule' }}
178-
runs-on: "ubuntu-latest"
177+
strategy:
178+
fail-fast: false
179+
matrix:
180+
os: [ubuntu-latest, windows-latest, macos-13]
181+
python: [cp37, cp38, cp39, cp310, cp311, cp312]
182+
183+
name: build/${{ matrix.os }}/${{ matrix.python }}
184+
runs-on: ${{ matrix.os }}
185+
179186
steps:
180187
- name: Checkout Source
181188
uses: actions/checkout@v4
@@ -187,14 +194,11 @@ jobs:
187194
- name: Install Python
188195
uses: actions/setup-python@v4
189196
with:
190-
python-version: "3.12"
197+
python-version: ${{ matrix.python }}
191198

192199
- name: Install master versions
193200
run: |
194-
pip install git+https://github.com/epics-base/p4p.git git+https://github.com/epics-base/pvxs.git
195-
pip install git+https://github.com/epics-base/epicscorelibs.git@fix-compiler-detection
196-
pip install git+https://github.com/DiamondLightSource/aioca git+https://github.com/DiamondLightSource/cothread
197-
pip install -e .[dev]
201+
pip install git+https://github.com/epics-base/epicscorelibs.git@fix-compiler-detection -e .[dev]
198202
pip freeze
199203
200204
- name: Run tests

0 commit comments

Comments
 (0)