Skip to content

Commit fa56774

Browse files
committed
Use py3.10 to 3.12 matrix CI
1 parent 788b7f9 commit fa56774

File tree

1 file changed

+56
-8
lines changed

1 file changed

+56
-8
lines changed

.github/workflows/matrix-and-codecov-on-merge-to-main.yml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,59 @@ on:
1111
workflow_dispatch:
1212

1313
jobs:
14-
matrix-coverage:
15-
uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
16-
with:
17-
project: diffpy.pdffit2
18-
c_extension: true
19-
headless: false
20-
secrets:
21-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
14+
coverage:
15+
defaults:
16+
run:
17+
shell: bash -l {0}
18+
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
24+
python-version: ["3.10", "3.11", "3.12"]
25+
env:
26+
LATEST_PYTHON_VERSION: "3.12"
27+
steps:
28+
- name: Check out diffpy.pdffit2
29+
uses: actions/checkout@v4
30+
31+
- name: Initialize miniconda
32+
uses: conda-incubator/setup-miniconda@v3
33+
with:
34+
activate-environment: test
35+
auto-update-conda: true
36+
environment-file: environment.yml
37+
auto-activate-base: false
38+
python-version: ${{ matrix.python-version }}
39+
40+
- name: Conda config
41+
run: >-
42+
conda config --set always_yes yes
43+
--set changeps1 no
44+
45+
- name: Install diffpy.pdffit2 and requirements
46+
run: |
47+
conda install --file requirements/conda.txt
48+
conda install --file requirements/test.txt
49+
conda install --file requirements/build.txt
50+
python -m pip install . --no-deps
51+
52+
- name: Start Xvfb for ubuntu-latest only
53+
if: matrix.os == 'ubuntu-latest'
54+
run: |
55+
sudo apt-get install -y xvfb
56+
export DISPLAY=:99
57+
Xvfb :99 -screen 0 1024x768x16 &
58+
59+
- name: Validate diffpy.pdfffit2
60+
run: |
61+
pytest --cov
62+
coverage report -m
63+
codecov
64+
65+
- name: Upload coverage to Codecov
66+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION
67+
uses: codecov/codecov-action@v4
68+
env:
69+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)