-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add GitHub Actions CI workflow #13288
Conversation
Additional notes:
|
272c1d9
to
c07cf56
Compare
No change rebase, on top of the most recent CMake overhaul commit. |
c07cf56
to
64d4471
Compare
Force push: removed the toolset specification for Windows builds, so that it is clear that everything is built with the latest stable VS 2019 Enterprise tools. Turns out GitHub Actions runners don't keep older point releases around, so specifying the tool versions with |
d59502b
to
8cd73fd
Compare
I'm sorry, but I still don't understand why it's required to be added in this PR. |
I've explained its purpose before: #12746 (comment), #12746 (comment) (first 2 paragraphs). Try to build qBittorrent with the |
How is it related to this PR? Is any graphs producing required here? |
Yes, it's useful to see and troubleshoot the actual resulting dependency graph of the build. This was already relevant for #12746, so that the user could produce uncluttered graphs if they chose to, when building. But it is even more relevant in this PR. Download one of the zips from https://github.com/FranciscoPombal/qBittorrent/actions/runs/223928661, and imagine how much more annoying it would be if the zip contained many little graph files instead. Thanks to this configuration file it contains just one. |
Really? I haven't seen any complaints about it not being in current CI builds. |
It's not a solution to some specific complaint, it's just a general improvement.
Yes, but not just that they are buildable, but also built the same way (or at least without surprising changes). I want to have confidence that changes I make which shouldn't impact the way qBittorrent is built on other platforms live up to that promise. This is especially useful when making changes/improvements to the build system.
Not all developers have one machine with each of the supported operating systems. If someone complains there is something wrong when they tried to build on macOS, it is much easier to troubleshoot if everyone (even those who do not own systems with macOS/Hackintoshes/don't have macOS VMs set up) can use the files produced by the macOS CI runs as a canonical point of reference. CI is meant to both verify that things still build fine and provide useful reference information for troubleshooting. You could make a similar argument for the generated executable + pdb file. If you consider them useful, why not the graph? If you're concerned about performance, don't be, CMake generates this graph really fast.
I'll consider it, but for now I believe I've refuted the central premises of |
Okay, maybe producing dependency graph on CI really makes sense. I don't deal with CMake that closely, so it doesn't concern me. |
If it is approved, shouldn't we remove all similar(CMake based) configurations from other CI environments in the same PR? |
These are the changes from default:
To give more information about custom target by default; I think this will be quite useful if we ever add custom targets. A little more information is always welcome
When both of these are false, only the final overall graph is generated. This prevents spam of lots of little files.
This makes the Overall I think we should select the defaults that are most convenient for CI. If the options we choose for the CI don't suit someone's graph-generation preferences, they can always change it locally. I do wish there was a better way to pass these options than editing a specifically-named file, but sadly this is currently not possible. However, thinking about it a little better now, I think it would be beneficial to open up discussion about exactly which graph-generation options are "most convenient for CI". From this standpoint, it is indeed better to factor this out to another PR. I don't expect it will be too different from this, though. I'll just take care of the other prerequisite PR first, before factoring out the CMake graphviz stuff. |
e978ffe
to
79f0d77
Compare
150389d
to
1d77c00
Compare
About this force push: Seems like something changed with GitHub actions runners, such that when using Ninja, GCC is detected as the default compiler, which breaks the build. I came across this problem when reusing this PR for other things recently. So I have made a minor change to the Windows job, it now uses the I have reported the bug here: actions/runner-images#1621 Sample run showing that it works now again: https://github.com/FranciscoPombal/qBittorrent/runs/1138166418 diff: run: |
- cmake -B build -G "Ninja" `
+ cmake -B build -G "Visual Studio 16 2019" `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DEST_WIN }}/scripts/buildsystems/vcpkg.cmake `
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
-DVERBOSE_CONFIGURE=ON `
--graphviz=build/target_graph.dot
- cmake --build build
+ cmake --build build --config RelWithDebInfo -- /p:UseMultiToolTask=true
- name: upload artifact as zip
uses: actions/upload-artifact@v2.1.3 The |
1d77c00
to
a6c82b5
Compare
@Chocobo1, @FranciscoPombal
|
This is a very controversial decision. Instead of fixing script so that it uses the compiler we need with previously selected generator, you just changed the generator. I would agree with this if you made an equivalent substitution (for example, jom). But "Visual Studio"?.. Personally, I don't see any practical value for these generators other than loading CMake project to Visual Studio IDE. I think it's perverse to use these tools in a non-interactive environment. |
a6c82b5
to
7eec28b
Compare
You're right, I changed it to use Ninja + the |
- Ubuntu 18.04/20.04, GUI ON/OFF - Windows 2019 - macOS 10.15 GUI ON/OFF
7eec28b
to
eed50c4
Compare
I've given up completely on the upstream inclusion of a |
@Chocobo1, @FranciscoPombal |
@FranciscoPombal |
This has been ready for 3 days.
The static builds? In case it wasn't clear before: sure! I also think it would be very useful. I thought it was understood that it was out of scope of this PR - but this PR was definitely made with such future extensions in mind. |
I think we can also add a badge in README.md, see: https://docs.github.com/en/actions/managing-workflow-runs/adding-a-workflow-status-badge |
|
@FranciscoPombal |
Add GitHub Actions CI workflow
Sorry for necro-posting and sorry for plugging my website. But, Since this mentions "nightly" builds (and I'm not sure what exact purpose was in mind) -- |
Depends on#12746#13327 (it's rebased on top of that one).master
is now ready for this.The workflow runs on pushes to master or any events from PRs that target master.
It takes 10 to 15 minutes to complete if cached.
The very first time around (or if the caches are dropped due to not being used for a week) there will be no caches. Without caches, it takes 1:30 to 3 hours.
It's quite readable and maintainable: only
230240 lines for all OS/GUI combinations we currently have in CI, plus Ubuntu 20.04, which we currently don't have. It does not depend in any way on packages/archives from builds.shiki.hu. All dependencies are built from official sources, and it's easier to change out their versions.It only covers building with CMake. If something similar is desirable for qmake builds, I think it should be done in another workflow file.
The build artifacts are published after the build is finished, which may come in handy for testing purposes.
Example cached run: https://github.com/FranciscoPombal/qBittorrent/actions/runs/223928661
Most of this is based on lessons learned from #13070. Both can coexist and are independent of each other, but this one is the one that will use caching (cache space is limited to 5 GiB), because nobody wants CI that takes hours to complete, whereas nightly builds with various combinations of dependency versions for user testing on Windows is not as time-sensitive.