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

Bazel CI #295

Merged
merged 136 commits into from
Feb 22, 2023
Merged

Bazel CI #295

merged 136 commits into from
Feb 22, 2023

Conversation

fmorency
Copy link
Contributor

@fmorency fmorency commented Feb 2, 2023

  • CI uses Bazel for lint/build/test/coverage and more.
  • Use BuildBuddy Bazel remote cache capabilities
  • Use Bazel binaries in Bats tests
  • Nuke Nix; build Docker images using Bazel
  • Refactor resiliency tests to use Bazel Docker images
  • Use xlarge Linux Docker executor in CI for everything except Docker-related steps
  • Run e2e Bats tests via Bazel
  • Run resiliency Bats tests via Bazel
  • Enable token test that was not supported by Nix
  • Remove staging file duplication
  • Make BATs file output TAP-compliant
  • bats-assert and bats-support are now handled by Bazel

Fixes #294
Fixes #264
Fixes #265

TODO:

  • Build Docker images on macos (building works, I need a system to test it on!)
  • Proper Bazel transitions
  • Optimizations
  • DRY (macros)

@fmorency fmorency added enhancement New feature or request ci labels Feb 2, 2023
@fmorency fmorency self-assigned this Feb 2, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2023

Codecov Report

Merging #295 (81f8041) into main (c9a5338) will increase coverage by 10.38%.
The diff coverage is 75.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff             @@
##             main     #295       +/-   ##
===========================================
+ Coverage   73.09%   83.47%   +10.38%     
===========================================
  Files         174      127       -47     
  Lines       22815    14703     -8112     
===========================================
- Hits        16676    12273     -4403     
+ Misses       6139     2430     -3709     
Impacted Files Coverage Δ
src/many-modules/src/_7_kvstore_commands/put.rs 95.31% <75.00%> (-2.94%) ⬇️
src/many-ledger/src/module/ledger_tokens.rs 83.82% <0.00%> (-5.24%) ⬇️
src/many-protocol/src/response.rs 90.44% <0.00%> (-1.69%) ⬇️
src/many-kvstore/src/module.rs 83.00% <0.00%> (-1.50%) ⬇️
src/many-protocol/src/lib.rs 96.80% <0.00%> (-1.07%) ⬇️
src/many-ledger/src/storage/multisig.rs 96.12% <0.00%> (-0.44%) ⬇️
src/many-mock/src/lib.rs 90.24% <0.00%> (-0.24%) ⬇️
src/many-migration/src/lib.rs 67.53% <0.00%> (-0.10%) ⬇️
src/many-ledger/test-utils/src/lib.rs 95.30% <0.00%> (-0.01%) ⬇️
src/many-identity-webauthn/src/verifier.rs 96.59% <0.00%> (ø)
... and 56 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@fmorency fmorency requested a review from hansl February 17, 2023 21:49
@fmorency
Copy link
Contributor Author

fmorency commented Feb 17, 2023

@hansl I'm not 100% finished and need to merge main into this branch, but I think you can start reviewing

@fmorency fmorency marked this pull request as ready for review February 17, 2023 21:49
- run:
name: installing bazelisk
command: |
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.15.0/bazelisk-linux-amd64
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to check the SHA?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SHAs are currently unavailable from the Bazelisk GitHub release page. I asked on their Slack.

- run:
name: installing bazelisk
command: |
curl -L -O https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-darwin-amd64
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above. Also I can't remember but I think brew is installed on those machines, so just brew install bazelisk could do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It takes forever to run brew on the CI (I stopped it after 2mins) vs fetching the binary (2s).

Let's stick to the current method.

BUILD.bazel Outdated Show resolved Hide resolved
BUILD.bazel Show resolved Hide resolved
WORKSPACE.bazel Show resolved Hide resolved
docker/.gitignore Outdated Show resolved Hide resolved
docker/Makefile Show resolved Hide resolved
third_party/cargo/patches/BUILD Outdated Show resolved Hide resolved
tests/test_helper/many.bash Outdated Show resolved Hide resolved
third_party/cargo/patches/BUILD Outdated Show resolved Hide resolved
fmorency and others added 8 commits February 21, 2023 15:00
Co-authored-by: Hans Larsen <[email protected]>
Signed-off-by: Félix C. Morency <[email protected]>
Co-authored-by: Hans Larsen <[email protected]>
Signed-off-by: Félix C. Morency <[email protected]>
Co-authored-by: Hans Larsen <[email protected]>
Signed-off-by: Félix C. Morency <[email protected]>
@fmorency fmorency requested a review from hansl February 21, 2023 21:34
@fmorency fmorency enabled auto-merge (squash) February 22, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate BATs tests to Bazel Migrate Docker Nix to Bazel Bazel + CI
3 participants