-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
chore(ci): define a pipeline with multiple gates #1414
chore(ci): define a pipeline with multiple gates #1414
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
To match with the generated pipeline for new modules
It will allow each template to process the list of modules correctly
matrix: | ||
go-version: [1.19.x, 1.x] | ||
platform: [ubuntu-latest, macos-latest] | ||
module: [compose, couchbase, k3s, localstack, mysql, neo4j, postgres, pulsar, redis, redpanda, vault] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if we can auto discover the folders under modules to build the matrix automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is autogenerated by the modules generator
I need to adjust the repository settings for the gh check |
* main: chore(deps): bump github.com/hashicorp/consul/api in /examples/consul (testcontainers#1381) chore(deps): bump github.com/twmb/franz-go in /modules/redpanda (testcontainers#1387) chore(deps): bump github.com/nats-io/nats.go in /examples/nats (testcontainers#1389) feat(redpanda): Add option to enable topic auto-creation (testcontainers#1360) chore(deps): bump golang.org/x/text from 0.9.0 to 0.11.0 in /modulegen (testcontainers#1388) chore(deps): bump google.golang.org/api from 0.125.0 to 0.134.0 in /examples (testcontainers#1412) chore(deps): bump golang.org/x/mod and github.com/aws/aws-sdk-go-v2/config in /modules/localstack (testcontainers#1410) test: fix TestGetDockerConfig (testcontainers#1413)
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
What does this PR do?
This PR refactors all the CI infrastructure, having one big workflow file instead of multiple ones. After these changes, the
ci.yml
file is the single source of truth in terms of CI pipelines, defining multiple what I call "quality gates", which is nothing than different gates in the pipeline that will have more importance depending on when they are run in the pipeline: those to the left in the diagram will run earlier because they have more priority.In this big workflow we will define dependency relationships, leveraging the
needs
keyword from GH actions, therefore one "stage" o GH job, won't be triggered until its needed job has finished with success. The proposed pipeline defines:At the same time, we have created a reusable workflow to run the Go tests (see
ci-test-go.yml
file) to run the Go tests. It will receive certain input parameters to configure the execution:TESTCONTAINERS_RYUK_DISABLED
environment variableAn example usage of this reusable module:
As a result, we will be able to run the tests for the core library, the different Docker configs (e.g. rootless), tests for each Go module, with a single reusable workflow, which will define a proper visual name, based on the input parameters used to call it.
Finally, and because creating a new module using the module generator tool created a workflow for each module, we modified the code generator to generate the new pipeline file, adding a list of modules/examples to the matrix of modules/examples.
Why is it important?
We have experimented many situations where our CI jobs take a lot of time to be processed, mainly after an updates wave from @dependabot. This happens basically because the jobs get queued because the number of allocated CI workers is passing the limit of workers in the entire @testcontainers organisation!! AND THIS IS AN ISSUE AS WE WERE IMPACTING OTHER TC-LANG PROJECTS.
With this new approach, we will reduce the number of workers needed by each "gate", reducing the workers that are needed at the same time. From an initial ramp up of +90 workers, we will have:
allowing more granularity when new PRs (in any repo of the org) come to grab a free worker.
How to test this PR
The result in the GH actions UI will be: https://github.com/testcontainers/testcontainers-go/actions/runs/5750784979?pr=1414