Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
ci: name dispatch workflow differently to default branch push workflow
Browse files Browse the repository at this point in the history
This allows the status of the two workflows to be distinguished, which
is important for the status badges offered by GitHub (at the moment we
show the status of the "Test" workflow, which means that a broken
dispatch build can show a red status despite the latest master build
succeeding).

Whilst we are at it, re-enable the go:generate of the workflows
themselves.

Change-Id: I2e93ab6839395fc92fec5f1f869c96854b63b22f
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6887
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
  • Loading branch information
myitcv committed Aug 19, 2020
1 parent 6f84d11 commit c3f30d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/gen.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package workflows

// Disable generation of this script for now.
// go:generate go run cuelang.org/go/cmd/cue cmd genworkflows cuelang.org/go/internal/ci
//go:generate go run cuelang.org/go/cmd/cue cmd genworkflows cuelang.org/go/internal/ci
2 changes: 1 addition & 1 deletion .github/workflows/test_dispatch.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by internal/ci/ci_tool.cue; do not edit

name: Test
name: Test Dispatch
env:
GERRIT_COOKIE: ${{ secrets.gerritCookie }}
on:
Expand Down
6 changes: 3 additions & 3 deletions internal/ci/workflows.cue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

workflowsDir: *"./" | string @tag(workflowsDir)

workflows: [...{file: string, schema: (json.#Workflow&{})}]
workflows: [...{file: string, schema: (json.#Workflow & {})}]
workflows: [
{
file: "test.yml"
Expand All @@ -30,7 +30,7 @@ workflows: [
// TODO: drop when cuelang.org/issue/390 is fixed.
// Declare definitions for sub-schemas
#job: ((json.#Workflow & {}).jobs & {x: _}).x
#step: ((#job & {steps: _}).steps & [_])[0]
#step: ((#job & {steps: _}).steps & [_])[0]

#latestGo: "1.14.3"

Expand Down Expand Up @@ -161,7 +161,7 @@ test_dispatch: json.#Workflow & {
}
}

name: "Test"
name: "Test Dispatch"
env: GERRIT_COOKIE: "${{ secrets.gerritCookie }}"
on: ["repository_dispatch"]
defaults: run: shell: "bash"
Expand Down

0 comments on commit c3f30d8

Please sign in to comment.