Skip to content
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 Matrix to Buildkite pipeline file #723

Merged
merged 26 commits into from
Mar 21, 2022
Merged

Add Matrix to Buildkite pipeline file #723

merged 26 commits into from
Mar 21, 2022

Conversation

joshedney
Copy link
Contributor

@joshedney joshedney commented Mar 11, 2022

Goal

Reduce the noise in .buildkite/pipeline.yml by using matrix on steps where possible.

Design

Implement matrix on steps that share common setups and do not rely on

Testing

Full CI has been run

@joshedney joshedney changed the title Je/pipeline matrix Add Matrix to Buildkite pipeline file Mar 11, 2022
@joshedney joshedney self-assigned this Mar 11, 2022
@joshedney joshedney marked this pull request as ready for review March 11, 2022 15:58
@imjoehaines
Copy link
Contributor

Is it possible to reduce the duplication even more by doing something like this?

  - label: ":ruby: Ruby {{ matrix.ruby-version }} unit tests"
    matrix:
      adjustments:
        - with:
          ruby-version: "2.0"
          bundle-version: "1.12.0"
        - with:
          ruby-version: "2.1"
          bundle-version: "1.12.0"
        - with:
          ruby-version: "2.2"
          bundle-version: "1.12.0"
          gemsets: "test sidekiq"
        - with:
          ruby-version: "2.3"
          bundle-version: "1.12.0"
          gemsets: "test sidekiq"
        - with:
          ruby-version: "2.4"
          gemsets: "test sidekiq"
        - with:
          ruby-version: "2.5"
          gemsets: "test sidekiq"
        - with:
          ruby-version: "2.6"
          gemsets: "test sidekiq"
        - with:
          ruby-version: "3.0"
          gemsets: "test sidekiq"
        - with:
          ruby-version: "3.1"
          gemsets: "test sidekiq"
    timeout_in_minutes: 30
    plugins:
      docker-compose#v3.1.0:
        run: ruby-unit-tests
        use-aliases: true
    env:
      RUBY_TEST_VERSION: "{{ matrix.ruby-version }}"
      BUNDLE_VERSION: "{{ matrix.bundle-version }}"
      GEMSETS: "{{ matrix.gemsets }}"
    concurrency: 4
    concurrency_group: "ruby/unit-tests"

@joshedney
Copy link
Contributor Author

I don't believe so. I've tried a couple of different layouts trying to get the most efficient combination. My understanding is this:

If we had the below matrix

matrix:
  setup:
    version:
      - '2.2'
      - '2.3'
    gemsets:
      - 'test sidekiq'
    bundle_version:
      - '1.12.0'
  adjustments:
    - with:
        version: '2.2'
        gemsets: ''
        bundle_version: '1.12.0'

It would end up running 3 tests in total.

One with version:2.2, gemsets: test sidekiq, bundle_version: 1.12.0

The second with `version: 2.3, gemsets: test sidekiq, bundle_version: 1.12.0'

And the third one would be version: 2.2, gemsets:, bundle_version: 1.12.0

We could add the variations that we'd want and then skip the ones that we know would fail, but we'd then end up with more duplication.

Copy link
Contributor

@imjoehaines imjoehaines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some small changes, then this looks fine (other than how half-baked the feature is ☹️)

Can you squash merge this so we don't keep the intermediate commits?

.buildkite/pipeline.yml Outdated Show resolved Hide resolved
.buildkite/pipeline.yml Outdated Show resolved Hide resolved
.buildkite/pipeline.yml Outdated Show resolved Hide resolved
.buildkite/pipeline.yml Outdated Show resolved Hide resolved
.buildkite/pipeline.yml Outdated Show resolved Hide resolved
Comment on lines 300 to 311
- label: ':rails: Rails 4 Ruby 2.3 tests'
timeout_in_minutes: 30
plugins:
docker-compose#v3.1.0:
run: ruby-maze-runner
use-aliases: true
command: ["features/rails_features/", "--tags", "@rails3 and not @wip"]
command: ["features/rails_features/", "--tags", "@rails4 and not @wip"]
env:
RUBY_TEST_VERSION: "2.4"
RAILS_VERSION: "3"
RUBY_TEST_VERSION: "2.3"
RAILS_VERSION: "4"
concurrency: 8
concurrency_group: 'ruby/slow-maze-runner-tests'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a duplicate of the step above

joshedney and others added 2 commits March 21, 2022 15:26
Co-authored-by: Joe Haines <hello@joehaines.co.uk>
Co-authored-by: Joe Haines <hello@joehaines.co.uk>
joshedney and others added 4 commits March 21, 2022 15:26
Co-authored-by: Joe Haines <hello@joehaines.co.uk>
Co-authored-by: Joe Haines <hello@joehaines.co.uk>
Co-authored-by: Joe Haines <hello@joehaines.co.uk>
@joshedney joshedney merged commit caf3ecc into master Mar 21, 2022
@joshedney joshedney deleted the je/pipeline-matrix branch March 21, 2022 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants