Skip to content

Commit 790f0d9

Browse files
committed
Further refinements to CodeEntropy CI:
- Combined and condensed the two CI files into one single file - `MDAnalysis` is set to schedule run every monday morning at 08:00 UTC - Refined the issue creation using a standard library approach to reduce complexity - Addition of a `mdanalysis-compatibility-failure.md` to auto create an issue to be submitted to GitHub to resolve
1 parent 4b580db commit 790f0d9

3 files changed

Lines changed: 98 additions & 123 deletions

File tree

.github/workflows/mdanalysis-compatability-matrix.yaml

Lines changed: 0 additions & 80 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: CI Failure: MDAnalysis v{{ env.MDA_VERSION }} / Python {{ env.PYTHON_VERSION }}
3+
labels: CI Failure, MDAnalysis Compatibility
4+
---
5+
6+
### Automated MDAnalysis Compatibility Test Failure
7+
8+
**MDAnalysis version**: `{{ env.MDA_VERSION }}`
9+
**Python version**: `{{ env.PYTHON_VERSION }}`
10+
**Workflow Run**: [Run #{{ env.RUN_NUMBER }}]({{ env.RUN_URL }})

.github/workflows/project-ci.yaml

Lines changed: 88 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7+
schedule:
8+
- cron: '0 8 * * 1'
79

810
jobs:
911
tests:
@@ -14,57 +16,100 @@ jobs:
1416
python-version: ["3.11", "3.12", "3.13"]
1517
name: Run tests
1618
steps:
17-
- name: Checkout repo
18-
uses: actions/checkout@v4
19+
- name: Checkout repo
20+
uses: actions/checkout@v4
1921

20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v5
22-
with:
23-
python-version: ${{ matrix.python-version }}
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
2426

25-
- name: Install CodeEntropy and its testing dependencies
26-
shell: bash
27-
run: pip install -e .[testing]
27+
- name: Install CodeEntropy and its testing dependencies
28+
run: pip install -e .[testing]
2829

29-
- name: Run test suite
30-
shell: bash
31-
run: pytest --cov CodeEntropy --cov-report term-missing --cov-append .
30+
- name: Run test suite
31+
run: pytest --cov CodeEntropy --cov-report term-missing --cov-append .
3232

33-
- name: Coveralls GitHub Action
34-
uses: coverallsapp/github-action@v2.3.6
35-
with:
36-
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
33+
- name: Coveralls GitHub Action
34+
uses: coverallsapp/github-action@v2.3.6
35+
with:
36+
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
3737

3838
docs:
3939
runs-on: ubuntu-latest
4040
timeout-minutes: 15
4141
steps:
42-
- uses: actions/checkout@v4
43-
- name: Set up Python 3.12
44-
uses: actions/setup-python@v5
45-
with:
46-
python-version: 3.12
47-
- name: Install python dependencies
48-
run: |
49-
pip install --upgrade pip
50-
pip install -e .[docs]
51-
- name: Build docs
52-
run: cd docs && make
42+
- uses: actions/checkout@v4
43+
- name: Set up Python 3.12
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: 3.12
47+
- name: Install python dependencies
48+
run: |
49+
pip install --upgrade pip
50+
pip install -e .[docs]
51+
- name: Build docs
52+
run: cd docs && make
5353

5454
pre-commit:
55-
runs-on: ubuntu-latest
56-
timeout-minutes: 15
57-
steps:
58-
- uses: actions/checkout@v4
59-
- name: Set up Python 3.11
60-
uses: actions/setup-python@v5
61-
with:
62-
python-version: 3.11
63-
- name: Install python dependencies
64-
run: |
65-
pip install --upgrade pip
66-
pip install -e .[pre-commit,docs,testing]
67-
- name: Run pre-commit
68-
run: |
69-
pre-commit install
70-
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 15
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Set up Python 3.11
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: 3.11
63+
- name: Install python dependencies
64+
run: |
65+
pip install --upgrade pip
66+
pip install -e .[pre-commit,docs,testing]
67+
- name: Run pre-commit
68+
run: |
69+
pre-commit install
70+
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
71+
72+
mdanalysis-compatibility:
73+
if: github.event_name == 'schedule'
74+
runs-on: ubuntu-latest
75+
timeout-minutes: 15
76+
strategy:
77+
matrix:
78+
python-version: ["3.11", "3.12", "3.13"]
79+
mdanalysis-version: ["2.7.0", "2.8.0", "2.9.0", "latest"]
80+
name: MDAnalysis v${{ matrix.mdanalysis-version }} / Python ${{ matrix.python-version }}
81+
steps:
82+
- name: Checkout repo
83+
uses: actions/checkout@v4
84+
85+
- name: Set up Python ${{ matrix.python-version }}
86+
uses: actions/setup-python@v5
87+
with:
88+
python-version: ${{ matrix.python-version }}
89+
90+
- name: Install dependencies with MDAnalysis ${{ matrix.mdanalysis-version }}
91+
run: |
92+
pip install --upgrade pip
93+
pip install -e .[testing]
94+
if [ "${{ matrix.mdanalysis-version }}" = "latest" ]; then
95+
pip install MDAnalysis
96+
else
97+
pip install "MDAnalysis==${{ matrix.mdanalysis-version }}"
98+
fi
99+
100+
- name: Run compatibility tests
101+
run: pytest --cov CodeEntropy --cov-report=term-missing --cov-append
102+
103+
- name: Create Issue on Failure
104+
if: failure()
105+
uses: JasonEtco/create-an-issue@v2
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
PYTHON_VERSION: ${{ matrix.python-version }}
109+
MDA_VERSION: ${{ matrix.mdanalysis-version }}
110+
RUN_NUMBER: ${{ github.run_number }}
111+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
112+
with:
113+
filename: .github/mdanalysis-compatibility-failure.md
114+
update_existing: true
115+
search_existing: open

0 commit comments

Comments
 (0)