Skip to content

Commit

Permalink
ci: fix workflow definitions
Browse files Browse the repository at this point in the history
1. Currently builds are not happening on master (very bad)
2. goreleaser builds are not working (very annoying)

Problem 1 was created by an "if" constraint being in the wrong place on
the start job for the test workflow. Because the test job depends on the
start job, the start job must run. Therefore we add a condition to every
step in the start job instead... which is easy using CUE.

Fix both of these.

Fixes #671

Change-Id: I0a36a44f35733dfd866f01dc608e35efcd1c5eab
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8404
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
  • Loading branch information
myitcv committed Jan 29, 2021
1 parent a616925 commit 9b7fc4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Run GoReleaser
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
uses: docker://goreleaser/goreleaser:latest
uses: docker://goreleaser/goreleaser:v0.110.0
with:
args: release --rm-dist
docker:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ jobs:
defaults:
run:
shell: bash
if: ${{ startsWith(github.ref, 'refs/heads/ci/') }}
steps:
- name: Write the gitcookies file
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') }}
name: Write the gitcookies file
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
- name: Update Gerrit CL message with starting message
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') }}
name: Update Gerrit CL message with starting message
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"message":"Started
the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{
github.run_id }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
Expand Down
4 changes: 2 additions & 2 deletions internal/ci/workflows.cue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test: _#bashWorkflow & {
jobs: {
start: {
"runs-on": _#linuxMachine
if: "${{ \(_#isCLCITestBranch) }}"
steps: [...(_ & {if: "${{ \(_#isCLCITestBranch) }}"})]
steps: [
_#writeCookiesFile,
_#startCLBuild,
Expand Down Expand Up @@ -200,7 +200,7 @@ release: _#bashWorkflow & {
}, {
name: "Run GoReleaser"
env: GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}"
uses: "docker://goreleaser/goreleaser:latest"
uses: "docker://goreleaser/goreleaser:v0.110.0"
with: args: "release --rm-dist"
}]
}
Expand Down

0 comments on commit 9b7fc4b

Please sign in to comment.