pdlgen icon indicating copy to clipboard operation
pdlgen copied to clipboard

use github action to generate cdproto

Open ZekeLu opened this issue 3 years ago • 0 comments

  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:

  • https://docs.github.com/en/actions/reference/encrypted-secrets
  • https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

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.

ZekeLu avatar May 26 '21 08:05 ZekeLu