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

Fix #2: Introduce GitHub Actions #6

Open
wants to merge 8 commits into
base: introduce-proto-api-v1
Choose a base branch
from

Conversation

anandwana001
Copy link

@anandwana001 anandwana001 commented Oct 25, 2021

Fix #2

Introduced GitHub action, for every push event on develop branch it will run a bazel build check for android_protos.
Two files were added in this PR:

  1. .github/workflow/bazel_build.yml
  2. .gitignore

TODO

  1. Add Buildifier to run on actions.

Other files are from the PR #1

Bazel build on local.
Screenshot 2021-10-25 at 15 48 58

WORKSPACE Outdated
http_archive(
name = "io_bazel_rules_go",
sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f",
urls = [
Copy link
Author

@anandwana001 anandwana001 Oct 25, 2021

Choose a reason for hiding this comment

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

@BenHenning Didn't add to deps.bzl as the urls here are array, should we update the _DEPENDENCY_VERSIONS to accept URLs as an array or should we keep these here?

Copy link
Member

Choose a reason for hiding this comment

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

The multiple URLs are for redundancy. I suggest just picking whichever URL is closest to the existing URLs for parity, but yes we need to use deps.bzl since that will be consumed by users of the proto library (otherwise it may not build).

@BenHenning
Copy link
Member

@anandwana001 should this be based on the other PR rather than develop? It's a bit hard to review in its current state. Please assign back once my comment above is addressed & the PR is based off the other branch.

@BenHenning BenHenning removed their assignment Oct 26, 2021
@anandwana001 anandwana001 changed the base branch from develop to introduce-proto-api-v1 October 26, 2021 07:54
@anandwana001
Copy link
Author

I will get back to this PR today, got stuck at Bazel error regarding using the repository ``io-bazel-go` before loading the library when I am doing via deps.

Comment on lines +9 to +20
load("//repo:deps.bzl", "initializeGoDeps")
initializeGoDeps()

load("//repo:deps.bzl", "initializeBazelGazell")
initializeBazelGazell()

load("//repo:deps.bzl", "initializeProtobuf")
initializeProtobuf()

load("//repo:deps.bzl", "initializeBazelBuildTools")
initializeBazelBuildTools()

Copy link
Author

Choose a reason for hiding this comment

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

Throwing error when running bazel run //:buildifier

ERROR: Failed to load Starlark extension '@bazel_gazelle//:deps.bzl'.
Cycle in the workspace file detected. This indicates that a repository is used prior to being defined.
The following chain of repository dependencies lead to the missing definition.
 - @bazel_gazelle
This could either mean you have to add the '@bazel_gazelle' repository with a statement like `http_archive` in your WORKSPACE file (note that transitive dependencies are not added automatically), or move an existing definition earlier in your WORKSPACE file.
ERROR: cycles detected during target parsing
INFO: Elapsed time: 0.100s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

@anandwana001 anandwana001 linked an issue Dec 9, 2021 that may be closed by this pull request

- name: Build Oppia Proto API
run: |
bazel build -- //:android_protos
Copy link
Member

Choose a reason for hiding this comment

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

I suggest instead building //... (to make sure everything builds).

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.

Introduce GitHub Actions
3 participants