Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split CI builds by gems at top-level (#1249)
* fix: remove unneeded Appraisals for opentelemetry-registry It's not actually doing anything, so we skip it. * ci: remove ci-without-services.yml We're going to bring back these jobs in the next few commits, but we can delete it right now. * ci: remove toys/ci.rb We're going to replicate this in Actions natively, so that we can get more comprehensible build output. * ci: replace toys.rb functionality with an explosion of actions + yaml This replaces the "test it all in a loop" approach that `toys/ci.rb` was taking, by leveraging some more advanced features of GitHub Actions. To start, we construct a custom Action (not a workflow!) that can run all the tests we were doing with `toys/ci.rb`. It takes a few different inputs: gem to test, ruby version to use, whether or not to do rubocop, etc. Then, it figures out where in the repo that gem lives, sets up ruby (including appraisals setup, if necessary), and runs rake tests (and then conditionally runs YARD, rubocop, etc). Then, over in `ci.yml`, we list out all of the gems we currently have and chunk them up into different logical groups: - base (api, sdk, etc) - exporters - propagators - instrumentation that requires sidecar services to test - instrumentaiton that doesn't require anything special to test For most groups, we set up a matrix build of operating systems (ubuntu, macos, and windows) - except for the "instrumentation_with_services" group, because sidecar services are only supported on linux. For each matrix group (gem + os), we then have a build that has multiple steps - and each step calls the custom Action that we defined earlier, passing appropriate inputs. Each step tests a different ruby version: 3.1, 3.0, 2.7, or jruby - and we conditionally skip the step based on the operating system (we only run tests against ruby 3.1 for mac / windows, because the runners are slower and we can't launch as many at once). Notably, we have a few matrix exclusions here: things that wont build on macos or windows, but there aren't many. Finally, each group also maintains a "skiplist" of sorts for jruby - it's ugly, but some instrumentation just doesn't work for our Java friends. So we have a step that tests whether or not we should build the gem for jruby, and then the jruby step is skipped depending on the answer. We can't really use a matrix exclusion here because we don't use the ruby version in the matrix at all - otherwise we'd have a *huge* explosion of jobs to complete, when in reality we can actually install + test multiple ruby versions on a single runner, if we're careful. The net effect of all of this is that we end up having many different builds running in parallel, and if a given gem fails we can *easily* see that and get right to the problem. Builds are slightly faster, too. The major downsides are: - We need to add new gems to the build list when we create them. - We can't cache gems for appraisals, which adds a few minutes onto the build times (to be fair, we weren't caching anything before) - It's just kinda unwieldy. - I didn't improve anything around the actual release process yet. Future improvements could be: - Figuring out how to cache things with Appraisals, because I gave up after a whole morning of fighting bundler. - Dynamically generating things again, because it's annoying to add gems to the build matrices. * feat: add scary warning to instrumentation_generator re: CI workflows * fix: remove testing change * ci: Add note about instrumentation_with_services
- Loading branch information