-
Notifications
You must be signed in to change notification settings - Fork 19
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
Don't download the whole Boost.CI Repo in functions.star #185
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #185 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 20 20
Branches 10 10
=========================================
Hits 20 20 Continue to review full report at Codecov.
|
Please change
this is the starlark language, it's based on python, and very similar to python. The last line of .drone.star runs that load command. Maybe it could check if the file functions.star exists, and then take a different action. Load it from a different place. Another option, discussed in https://github.com/CPPAlliance/drone-ci/blob/master/docs/drone-ci.md , is to copy all the contents of functions.star directly into .drone.star. It may be this pull request is not backwards compatible, since drone has been rolled out already to many repositories. Notice the load command at the end of .drone.star is loading particular functions. It's not loading "unix_common" though, so "unix_common" won't be available in .drone.star. it would require 50 or 100 pull requests to all the boost libraries which is probably not worth it. On a different topic, if you are also reformatting .drone.star, take a look at https://github.com/boostorg/url/blob/develop/.drone.star That could be the new starting template. Include:
When there is so much variation and variety in the types of jobs in .drone.star, it might become more difficult to neatly and cleanly extrapolate or abstract that in functions. Just including all the parameters as-is, the way it's done now, seems ok. But if you are proposing new abstractions, we can consider them. For now, Linux amd64 and arm64 are autoscaled, so there is no limit. The others such as s390x are dedicated machines. That is the reason for having 1 windows job in the template, for now, and not 5 or 10 windows jobs included in the template. Eventually we might be able to get autoscaling on windows. |
Done. Test build at https://drone.cpp.al/boostorg/boost-ci/289
That is the idea. I just don't know how to do it as what is available in the language depends on the implementation, i.e. here it would be DroneCI specific and I wasn't able to find documentation on it. Do you have any?
Oh what? I thought it gets it from this repo directly. Again: Any docu on how the
That shouldn't be an issue. It is an implementation detail only. So the
I wanted to move away the duplication like I did in the GHA template: E.g. no need to specify compiler, B2_TOOLSET and packages as only 1 is required. See #184 for discussion on that, just a teaser: |
Only an implementation detail. If you say so. :-) How about this, when you're ready, check the new file into the master branch as functions2.star or functions.test.star. Alternatively, instead of checking it in, point me to a copy of the file, and I will manually copy it to the drone server. Either way, I will need to copy it to the drone server. Then, after it's online, adjust a .drone.star file in a test branch to use it, as follows:
|
Here are docs: https://docs.drone.io/pipeline/scripting/starlark/ This plugin is used: https://github.com/drone/drone-convert-starlark They write: "DEPRECATED: native Starlark support was added to Drone core. This extension is no longer required and has been deprecated." However, the native support doesn't have the "load" command. Thus, server-side includes are missing. So we're still using the plugin. |
So loading the updated file from here doesn't work :(
I'm done. Please take the file from this PR and give it a try :) |
Thanks for fixing the C&P issue. On the compare I think bash allows |
functions.test.star is on the server.
I also thought bash allows either the error:
could be the bourne shell. |
Looks good as far as I can tell: https://drone.cpp.al/boostorg/boost-ci/298
Ah yes, bash allows that but the initial script on Drone is run in plain shell |
Oh wait! |
Only download the required file(s). Move the command commands of all unix pipelines into a function to implement this only once
Factor it out into a helper function to allow changing it later
18a1d77
to
0ca328e
Compare
I shouldn't do that late... @sdarwin Can you install the latest version? I fixed the conditions and made the easier to read using plain |
The file is on the server as |
The conditions were inverted due to combination via `&&`. Use plain `if` to make it easier to read and echo when downloading anything. Also reformat to make it easier to read and append the extension to the script at the start to avoid forgetting it. [skip ci]
0ca328e
to
ab1fa82
Compare
Looks good so far, using it in Boost.Locale successfully. |
Is this deployed yet (as the original |
yes |
Test build at https://drone.cpp.al/boostorg/boost-ci/282
@sdarwin Please double check
BTW: Do you know of any way to conditionally include the
functions.star
from either the repo or local file so that we include the latest version from the PR instead if running on Boost.CI