[wp-trac] [WordPress Trac] #50401: Tests: Move tests into Github Actions

WordPress Trac noreply at wordpress.org
Tue Nov 24 17:22:00 UTC 2020


#50401: Tests: Move tests into Github Actions
------------------------------+--------------------------
 Reporter:  whyisjake         |       Owner:  desrosj
     Type:  task (blessed)    |      Status:  assigned
 Priority:  normal            |   Milestone:  5.6
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:  performance
------------------------------+--------------------------

Comment (by desrosj):

 I've been playing around with this a bit today, and created two PRs.

 [https://github.com/WordPress/wordpress-develop/pull/762 This one (762)]
 will prevent the workflows from running on any fork of `WordPress
 /wordpress-develop`. We could roll with this temporarily. However, if
 anyone wishes to run the workflows on their fork, they would have to
 override the `.yml` files and this would introduce the same headache we
 are trying to avoid.

 [https://github.com/WordPress/wordpress-develop/pull/761 The second PR
 (761)] is, in my opinion, the ideal solution. It disables the workflows on
 any repository that is not the official WordPress/wordpress-develop
 mirror, but also provides the fork owner with two options per workflow.
 - Enable all workflows to function on the fork exactly as they would for
 the mirror. (`WP_GHA_FORK`)
 - Enable an individual workflow to function exactly on the fork as they
 would for the mirror. (`WP_*`)
 - Enable an individual workflow to function for pull requests on the fork
 as they would for the mirror. (`WP_*_PR`)

 These secrets can be defined at the repository or organization/user level.

 It seems `secrets` and `env` variables are not available to the job
 specific `if:`s within the workflow file. `secrets` can be used in steps,
 but [https://docs.github.com/en/free-pro-team@latest/actions/reference
 /workflow-syntax-for-github-actions#jobsjob_idstepswith only when provided
 as an input]. While `env` context is documented as available to `with` and
 `name` keys for a job, and `if` [https://docs.github.com/en/free-pro-
 team at latest/actions/reference/context-and-expression-syntax-for-github-
 actions#env-context conditionals for a step], environment variables
 defined at the [https://github.community/t/how-to-set-and-access-a
 -workflow-variable/17335/6 workflow level are not available at the job
 level].

 One workaround could be to add a step to each workflow that happens first,
 checks for the presence of the secret, and cancels the job. However, this
 would still result in ''some'' workflow minutes being used, as the
 workflow would have to initialize and proceed to the first step in order
 to cancel, so that's not 100% ideal.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50401#comment:41>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list