publiclab / plots2

a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! :balloon:
https://publiclab.org
GNU General Public License v3.0
957 stars 1.83k forks source link

Convert all publiclab repositories' automated tests/checks from TravisCI to GitHub Actions #9641

Open jywarren opened 3 years ago

jywarren commented 3 years ago

Multi-repository coordinating issue:

starting in https://github.com/publiclab/plots2/issues/8793, we developed a plan to move all PL repositories from Travis CI to GitHub Actions, and have made a lot of progress. But there are many repositories still to go, so we are coordinating here.

If you'd like to try, unfortunately the PR must be created by a maintainer (for security purposes) but we'd love help as far as it's possible.

Try looking in the "DONE" section for examples of successful conversions of projects with similar architecture!

NOTE: the PR has to be opened from within the main fork, not from for example jywarren/gh-actions. See https://github.com/publiclab/infragram/pull/157

Remaining Travis => GitHub Actions migrations

Done

Badges

The new badge is in the format: https://github.com/publiclab/plots2/workflows/tests/badge.svg?branch=main

To get them running on the main branch, https://github.com/publiclab/PublicLab.Editor/pull/740 may be needed

And we can link it to: https://github.com/publiclab/plots2/actions (or another more specific one like https://github.com/publiclab/plots2/actions/workflows/tests.yml?query=branch%3Amain ? I can't find a route showing just those tests run on the publiclab/plots2 main branch though...

Badges changed

govindgoel commented 3 years ago

@jywarren I would start working on this.

muokicaleb commented 3 years ago

@jywarren I'd like to help with this issue.

bajajvinamr commented 3 years ago

@jywarren I'd like to work on this

jywarren commented 3 years ago

Hi all - thank you for your support! I'm currently working on this in https://github.com/publiclab/spectral-workbench/pull/647 (my top priority) and in https://github.com/publiclab/mapknitter/issues/1489 (2nd priority). I've made progress on the first but slowly trying to eliminate remaining errors, reading the log carefully each time. Any input/help/tips/support appreciated!!!

aliciapaz commented 3 years ago

Hello @jywarren, @govindgoel, and everyone else! Today I'm officially joining the GitHub Actions Migrations Task Force (or GAMTF) :octocat: 🚣🏽‍♀️ (yes I invented the name myself)

Given the list above, what do you think is the best one to start? My first thought is to go with the smaller repositories first (i.e: webjack?), but I'm open to suggestions.

Thank you all and have a wonderful week.

jywarren commented 3 years ago

Hi Alicia!!!!! Welcome!!! I'm so sorry I missed this as my notifications are quite narrowly tuned (you could imagine how many i get across all PL projects) - my sincere apologies. I've reached out on Gitter as well.

I think trying a smaller repository first to get the hang of it is a great idea. Then, taking them in order perhaps - i've ordered them with top = highest priority. And, I'll add your name to my notification filters! Thanks!!! May you have a wonderful week as well!

jywarren commented 3 years ago

This list is looking great! Excellent work, @aliciapaz!!

I'm also noting we will have to go back and add correct "CI passing" badges which I noticed in https://github.com/publiclab/image-sequencer#image-sequencer (still has the old Travis badge).

The new badge is: https://github.com/publiclab/plots2/workflows/tests/badge.svg?branch=main

And we can link it to: https://github.com/publiclab/plots2/actions (or another more specific one like https://github.com/publiclab/plots2/actions/workflows/tests.yml?query=branch%3Amain ? I can't find a route showing just those tests run on the publiclab/plots2 main branch though...

govindgoel commented 3 years ago

@jywarren along with the CI changes we can change the badge too. Thanks for the new badge URL. Meanwhile, I will look wherever the changes are needed.

@aliciapaz I also missed this, but I liked the name you invented for the task. Thanks

aliciapaz commented 3 years ago

@govindgoel so you will change the badges in the already migrated repositories, am I right? @jywarren I'm currently working on mapknitter (based on work by @cesswairimu, thanks!) Having some issues but so far nothing different from the ones you had in SWB. Hopefully, I'll get it done by today/tomorrow!

Thanks to both!

govindgoel commented 3 years ago

@aliciapaz Yeah will work on that also will take up a repo to migrate to actions.

Thanks

jywarren commented 3 years ago

Super, thanks all!!!

On Wed, Aug 18, 2021, 10:56 AM Govind Goel @.***> wrote:

@aliciapaz https://github.com/aliciapaz Yeah will work on that also will take up a repo to migrate to actions.

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/9641#issuecomment-901184628, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF6JZFTNL2OVLF7MNA623T5PCYJANCNFSM45DFJKLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

jywarren commented 3 years ago

OK - i made a new checklist for the badges. If we could get a more specific link for the badge that would be great, though - only recent runs of "tests" on main branch of publiclab's fork?

govindgoel commented 3 years ago

Okay @jywarren will look for that.

aliciapaz commented 2 years ago

@govindgoel we can use filters to achieve what @jywarren suggests: For example, to show recent runs of tests on the main branch of plots2: https://github.com/publiclab/plots2/actions/workflows/tests.yml?query=branch%3Amain

jywarren commented 2 years ago

I was able to do this in mapknitter -- unfortunately if we limit to main branch we get no status because there's no tests run on main - just on the PRs /before/ merging to main... a conundrum!

If we don't limit to main, then we get a failure because it reports output of ALL branches, including many which aren't merged yet.

main - https://github.com/publiclab/mapknitter/actions/workflows/tests.yml/badge.svg

vs

main - https://github.com/publiclab/mapknitter/actions/workflows/tests.yml/badge.svg?branch=main

Originally posted by @jywarren in https://github.com/publiclab/mapknitter/issues/1541#issuecomment-946856329

jywarren commented 2 years ago

Same on Spectral Workbench: https://github.com/publiclab/spectral-workbench/commit/5fa3c006f09423de38c6497df84d7a07126387af

So I was trying to set up a github actions run that'll run the tests one more time after merge, but I think i wasn't quite able to get that working...

https://github.com/publiclab/plots2/pull/9915 now shows green for plots2, BUT, it does occasionally fail because it's a re-run of the tests, and some tests are intermittent like #10341

AND unfortunately it runs on the main branch of ALL PRs, even if it's someone else's fork -- like https://github.com/publiclab/plots2/actions/runs/1358791409 - which happens a lot with first-timers. We could try discouraging it more, but it'll happen.

So the outcome is that for 2 different common reasons, this will end up showing failing tests pretty often.

I'd like to figure out a way we can either:

  1. get a merged PR's test run accepted as passed for the main branch??
  2. filter for workflow runs that were run on publiclab/plots2 main branch, and nobody else's
  3. filter for workflow runs that were on merged PRs only

So, for now we just have some grey badges but if we can fix them we can get this reporting properly again!

jywarren commented 2 years ago

Same at this useful badge generator; https://actions-badge.atrox.dev/

image

See how although the last PR at https://github.com/publiclab/plots2/pull/10329 passed fine, it links to this interesting view of several runs where the first passed, but the last failed; presumably all would need to pass for this to work:

https://github.com/publiclab/plots2/runs/3941473010

However, maybe this is slight progress, as I wonder if it's only checking publiclab/plots2 main branch runs.

jywarren commented 2 years ago

OK trying to trigger post-merge tests on main branch in mapknitter, which I think will be simpler and more consistent anyways: https://github.com/publiclab/mapknitter/commit/f658f6066e38e35cb6d8eae5628b7edc8bd0619d

aliciapaz commented 2 years ago

@jywarren if that works for mapknitter, shall we do the same for the rest? Thanks!

jywarren commented 2 years ago

Yeah i think so -- but it doesn't seem to have worked! https://github.com/publiclab/mapknitter/pull/1544

Did I miss something?

jywarren commented 2 years ago

I am monitoring here, but don't see any just after it was merged: https://github.com/publiclab/mapknitter/actions

Also it's weird - apparently it'd be the default branch on the default badge:

Tests and CI/CD jobs

I'm not sure if that actually worked because when i switch it to "main" it shows no runs:

Tests and CI/CD jobs