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

use github action to generate cdproto #14

Open
wants to merge 3 commits into
base: old
Choose a base branch
from

Conversation

ZekeLu
Copy link
Member

@ZekeLu ZekeLu commented May 26, 2021

  1. it makes the call to easyjson more reliable. Here are the details:
    1. remove easyjson.go from the white list so that deprecated files (if any) won't stay in the repository.
    2. generate easyjson.go stubs first so that the source codes are valid from the perspetive of syntax, which in turn makes
      it possible to run bootstrap.Generator one by one.
    3. run bootstrap.Generator one by one to avoid the occasional failure. Error messages when it failed (both the source file
      and import path changed from time to time when it failed):
      # github.com/chromedp/cdproto/cachestorage
      cachestorage/easyjson.go:8:3: can't find import: "encoding/json"
      # github.com/chromedp/cdproto/cast
      cast/easyjson.go:6:3: can't find import: "github.com/mailru/easyjson"
      
  2. The github action will do this jobs:
    1. run cdproto-gen to regenerate the cdproto package.
    2. test chromedp to with the new cdproto package.
    3. if the run is triggered manually, it will commit the changes to the the cdproto repository (to a new branch name build-[build id]. The maintainer can merge this branch after checking.

Note: an encrypted personal access token should be provided to push to the cdproto repository. See:

I have tested the workflow with my forked repository (see https://github.com/ZekeLu/pdlgen/actions), but maybe something should be changed to make it work for an organization repository.

1. remove "easyjson.go" from the white list so that deprecated
  files (if any) won't stay in the repository.
2. generate "easyjson.go" stubs first so that the source codes
  are valid from the perspetive of syntax, which in turn makes
  it possible to run bootstrap.Generator one by one.
3. run bootstrap.Generator one by one to avoid the occasional
 failure. Error messages when it failed (both the source file
 and import path changed from time to time when it failed):
   # github.com/chromedp/cdproto/cachestorage
   cachestorage/easyjson.go:8:3: can't find import: "encoding/json"
   # github.com/chromedp/cdproto/cast
   cast/easyjson.go:6:3: can't find import: "github.com/mailru/easyjson"
1. It can be triggered by push and pull request. The purpose is to
check the changes.

2. It can also be triggered manually. In this case, the versions
of chromium and v8 can be specified. If not specified, it defaults
to the latest version. The changes to the cdproto repository will
be committed to the "build-[id]" branch.
@ZekeLu ZekeLu changed the base branch from master to old May 26, 2021 08:05
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.

1 participant