Skip to content

Commit

Permalink
Merge pull request #727 from OpenFreeEnergy/add-api-breaking-detection
Browse files Browse the repository at this point in the history
detect if API breaks on PR
  • Loading branch information
IAlibay authored Nov 20, 2024
2 parents 6b3d1a7 + f24a252 commit e02dc01
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/change.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check for API breaks

on:
pull_request_target:
branches:
- main

jobs:
check:
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Check for API breaks
continue-on-error: true
id: check
run: |
pip install griffe
griffe check "openfe" --verbose
- name: Post Comment on Failure
if: steps.check.outcome == 'failure'
uses: actions/github-script@v7
with:
script: |
const prNumber = context.payload.pull_request.number;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: '🚨 API breaking changes detected! 🚨'
});
2 changes: 1 addition & 1 deletion openfe/analysis/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def plot_lambda_transition_matrix(matrix: npt.NDArray) -> Axes:
Notes
-----
Borrowed from `alchemlyb <https://github.com/alchemistry/alchemlyb/blob/master/src/alchemlyb/visualisation/mbar_matrix.py>`_
which itself borrows from `alchemical-analysis <https://github.com/MobleyLab/alchemical-analysis>`_.
which itself borrows from `alchemical-analysis <https://github.com/MobleyLab/alchemical-analysis>`_.
"""
num_states = len(matrix)

Expand Down

0 comments on commit e02dc01

Please sign in to comment.