mortbopet / Ripes

A graphical processor simulator and assembly editor for the RISC-V ISA
https://ripes.me/
MIT License
2.49k stars 270 forks source link

Discussion on Github Actions #333

Closed raccog closed 5 months ago

raccog commented 8 months ago

I started learning about Github Actions, since a bunch of the Ripes workflows would continuously fail in my forked repo. I have a few questions about how the Ripes workflow is setup. Figured that it'd make an interesting public discussion as well.

Firstly, I noticed that many workflows have the following run condition:

branches:
      - '*'

This causes these workflows to not run if the branch has the / character in it. I often prefix my branches with feature/ or fix/ to organize them and these workflows do not run when I push these branches. Was this done on purpose? Do you think it would be beneficial to use the following condition instead?

branches:
      - '**'

I think it would trigger these workflows on all branches (even if they contain /).

I also noticed that many workflows use secrets to automatically release. For example, wasm-release has the following token:

GH_TOKEN: ${{ secrets.MORTBOPET_GITHUB_IO_TOKEN }}

Since I don't have access to such secrets in my fork, the workflows that require secrets automatically fail. Do you know of any way that I could prevent only these workflows from running? I want to have all build workflows (ubuntu, macos, windows, wasm) run in my fork without any of the release workflows running.

I've been researching how Github Actions work, but I haven't yet found a way to disable specific workflows in my fork without changing the yml files. Perhaps we could change the release/artifact actions to add the following condition:

if: github.repository == 'mortbopet/Ripes'

I think this would make the release-based actions only run in your repository and not in any forks.

@mortbopet Please let me know what you think of these ideas.

mortbopet commented 7 months ago

Was this done on purpose?

Nope! Most of my branches are prefixed as well. Completely agree that the intended functionality here is enabled by '**'.

Perhaps we could change the release/artifact actions to add the following condition:

That seems like the most non-intrusive way of restricting that release step to run. One could want better "wrapping" functionality in github action workflows to have DRY'er workflows that allows forks to leverage the existing setup... maybe that's possible, and im 100% certain that the existing set of CI workflows could be cleaned up immensely if someone would want to spend a few days on it. But for now, let's go with the simple options, as you suggest 👍.