Skip to content

Commit

Permalink
[TT-13136] Adjust concurrency group to CI tests, extend to all workfl…
Browse files Browse the repository at this point in the history
…ows (#6560)

### **User description**
<details open>
<summary><a href="https://tyktech.atlassian.net/browse/TT-13136"
title="TT-13136" target="_blank">TT-13136</a></summary>
  <br />
  <table>
    <tr>
      <th>Summary</th>
<td>If a PR is rebased, or new commits are added, cancel previous
runs</td>
    </tr>
    <tr>
      <th>Type</th>
      <td>
<img alt="Task"
src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium"
/>
        Task
      </td>
    </tr>
    <tr>
      <th>Status</th>
      <td>In Dev</td>
    </tr>
    <tr>
      <th>Points</th>
      <td>N/A</td>
    </tr>
    <tr>
      <th>Labels</th>
      <td>-</td>
    </tr>
  </table>
</details>
<!--
  do not remove this marker as it will break jira-lint's functionality.
  added_by_jira_lint
-->

---

https://tyktech.atlassian.net/browse/TT-13136


___

### **PR Type**
enhancement, configuration changes


___

### **Description**
- Added concurrency group settings to multiple workflows to manage job
execution and cancellation.
- Introduced a new CI lint workflow with concurrency settings and job
definitions for godoc and jira.
- Removed outdated workflows for API changes, JIRA lint, and OAS
documentation updates.
- Updated Go version to stable in the Swagger lint workflow.


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>ci-tests.yml</strong><dd><code>Update concurrency
settings in CI tests workflow</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/ci-tests.yml

<li>Updated concurrency group settings for CI tests.<br> <li> Changed
the method to cancel in-progress jobs based on event type.<br>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6560/files#diff-03609cb60b0c6e92fb771eb8787d6722b8c31ca4c03eabc788e147acd8c6fb43">+2/-6</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>codeql-analysis.yml</strong><dd><code>Add concurrency
settings to CodeQL analysis workflow</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

.github/workflows/codeql-analysis.yml

<li>Added concurrency group settings.<br> <li> Enabled cancellation of
in-progress jobs for pull requests.<br>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6560/files#diff-63bd641104d10e25f141d518a16b22a151d125e12701df2f9e79734b23b90188">+4/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>lint-swagger.yml</strong><dd><code>Add concurrency and
update Go version in Swagger lint workflow</code></dd></summary>
<hr>

.github/workflows/lint-swagger.yml

<li>Added concurrency group settings.<br> <li> Enabled cancellation of
in-progress jobs for pull requests.<br> <li> Changed Go version to
stable.<br>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6560/files#diff-211d7beb5c2247bdb14cd6aaa6da2feb35176618e91541850a5f4eebf736990d">+5/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>lint.yml</strong><dd><code>Introduce new CI lint
workflow with concurrency settings</code>&nbsp; </dd></summary>
<hr>

.github/workflows/lint.yml

<li>Added new CI lint workflow.<br> <li> Included concurrency settings
and job definitions for godoc and jira.<br>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6560/files#diff-107e910e9f2ebfb9a741fa10b2aa7100cc1fc4f5f3aca2dfe78b905cbd73c0d2">+33/-0</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>plugin-compiler-build.yml</strong><dd><code>Add
concurrency settings to plugin compiler build
workflow</code></dd></summary>
<hr>

.github/workflows/plugin-compiler-build.yml

<li>Added concurrency group settings.<br> <li> Enabled cancellation of
in-progress jobs for pull requests.<br>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6560/files#diff-f3a95a900eb0ac23af6314e9cdea29fa16af0a9bcb61793a83a32ff13d4c4e79">+4/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>release.yml</strong><dd><code>Add concurrency settings
to release workflow</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/release.yml

<li>Added concurrency group settings.<br> <li> Enabled cancellation of
in-progress jobs for pull requests.<br>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6560/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools
and their descriptions

---------

Co-authored-by: Tit Petric <tit@tyk.io>
  • Loading branch information
titpetric and Tit Petric authored Sep 30, 2024
1 parent 685c35f commit c808608
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 65 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/api-changes.yml

This file was deleted.

8 changes: 2 additions & 6 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ on:
- master
- release-**

# Only have one runner per PR, and per merged commit.
#
# - As a PR gets new commits, any old run jobs get cancelled (PR number)
# - As a commit gets merged, it doesn't cancel previous running PR's (github.sha)
concurrency:
group: ${{ github.event.pull_request.number || github.sha }}-ci-tests
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
PYTHON_VERSION: "3.11"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
schedule:
- cron: '0 18 * * 4'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
analyze:
name: Analyze
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/jira-lint.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/lint-swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
paths:
- 'swagger.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
redocly_validator:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -41,7 +45,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
go-version: stable

- name: Install dyff binary
run: |
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# yamllint disable rule:truthy
---
name: CI lint

on:
pull_request:
branches:
- master
- release-**
push:
branches:
- master
- release-**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
godoc:
if: ${{ !github.event.pull_request.draft }}
uses: TykTechnologies/github-actions/.github/workflows/godoc.yml@main
secrets:
ORG_GH_TOKEN: ${{ secrets.ORG_GH_TOKEN }}
with:
go-version: stable

jira:
if: ${{ !github.event.pull_request.draft }}
uses: TykTechnologies/github-actions/.github/workflows/jira-lint.yaml@main
secrets:
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
ORG_GH_TOKEN: ${{ secrets.ORG_GH_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/plugin-compiler-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
env:
GOLANG_CROSS: 1.22-bullseye

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
docker-build:
runs-on: ubuntu-latest
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# yamllint disable rule:line-length rule:truthy
---
name: Release

# Generated by: gromit policy

# Distribution channels covered by this workflow
Expand All @@ -7,7 +11,10 @@
# - devenv ECR
# - Cloudsmith

name: Release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

on:
# Trigger release every monday at midnight for master CI images
schedule:
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/update-oas-docs.yml

This file was deleted.

0 comments on commit c808608

Please sign in to comment.