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

ci: add cancel-workflow-action functionality to all github workflows #6755

Conversation

aaron-prindle
Copy link
Contributor

fixes #6745

briandealwis
briandealwis previously approved these changes Oct 25, 2021
@briandealwis briandealwis changed the title fix: add cancel-workflow-action functionality to all github workflows ci: add cancel-workflow-action functionality to all github workflows Oct 25, 2021
@aaron-prindle aaron-prindle force-pushed the fix-6745_cancel-workflow-action branch 2 times, most recently from 093292e to e1302bc Compare October 25, 2021 20:08
@codecov
Copy link

codecov bot commented Oct 25, 2021

Codecov Report

Merging #6755 (116da5d) into main (290280e) will decrease coverage by 0.85%.
The diff coverage is 65.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6755      +/-   ##
==========================================
- Coverage   70.48%   69.62%   -0.86%     
==========================================
  Files         515      536      +21     
  Lines       23150    24431    +1281     
==========================================
+ Hits        16317    17011     +694     
- Misses       5776     6293     +517     
- Partials     1057     1127      +70     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/deploy.go 52.00% <ø> (-1.85%) ⬇️
cmd/skaffold/app/cmd/flags.go 89.00% <0.00%> (-1.82%) ⬇️
cmd/skaffold/app/cmd/render.go 36.66% <0.00%> (-4.72%) ⬇️
cmd/skaffold/skaffold.go 0.00% <ø> (ø)
cmd/skaffold/app/cmd/find_configs.go 48.88% <50.00%> (+0.24%) ⬆️
cmd/skaffold/app/cmd/lint.go 52.94% <52.94%> (ø)
cmd/skaffold/app/cmd/cmd.go 70.49% <75.00%> (-0.57%) ⬇️
cmd/skaffold/app/cmd/debug.go 100.00% <100.00%> (ø)
cmd/skaffold/app/cmd/runner.go 64.17% <100.00%> (ø)
cmd/skaffold/app/flags/image.go 76.27% <100.00%> (+3.72%) ⬆️
... and 126 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08852b0...116da5d. Read the comment docs.

@MarlonGamez
Copy link
Contributor

@aaron-prindle is there a reason these changes would make the CI not run? or is that just a coincidence

@tejal29 tejal29 self-assigned this Nov 1, 2021
@briandealwis
Copy link
Member

Uh oh, I don't think this can work as-is. The concurrency docs say:

Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can only use the github context. For more information about expressions, see "Expressions."
...
When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.

Since we're using the same string for each workflow here, only one will run: the others will be cancelled or made pending.

I think we might be able to append ${{github.workflow}}? The doc for concurrency doesn't say that it needs to have no whitespaces:

concurrency:
  group: build-${{ github.event.pull_request.number || github.ref }}-${{github.workflow}}
  cancel-in-progress: true

@briandealwis briandealwis dismissed their stale review November 1, 2021 21:24

doesn't seem to be working

@aaron-prindle
Copy link
Contributor Author

Made suggested change, seems like it is working now. Merged this in my branch to make sure it will take, CI is passing with this change merged on a test pr - aaron-prindle#87

@aaron-prindle aaron-prindle merged commit 6f33db9 into GoogleContainerTools:main Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the cancel-workflow-action to prevent previous workflows from running.
4 participants