From 529f88e6e1aa21d36472d396eaee9c30d7f2b5a8 Mon Sep 17 00:00:00 2001 From: Marko Date: Fri, 11 Mar 2022 08:55:03 +0100 Subject: [PATCH] chore: add timeouts to sims in ci (#11345) ## Description - add timeouts to sim ci - add job cleaning to nessecary workflows. - remove janitor --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- .github/workflows/janitor.yml | 16 ---------------- .github/workflows/proto-docker.yml | 3 +++ .github/workflows/release-sims.yml | 1 + .github/workflows/sims.yml | 11 +++++++++++ .github/workflows/test-race.yml | 12 ++++++++++++ .github/workflows/test.yml | 11 +++++++++++ 6 files changed, 38 insertions(+), 16 deletions(-) delete mode 100644 .github/workflows/janitor.yml diff --git a/.github/workflows/janitor.yml b/.github/workflows/janitor.yml deleted file mode 100644 index e6401dbc87..0000000000 --- a/.github/workflows/janitor.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Janitor -# Janitor cleans up previous runs of various workflows -# Cancels Sims and Tests -on: - pull_request: - -jobs: - cancel: - name: "Cancel Previous Runs" - runs-on: ubuntu-latest - timeout-minutes: 3 - steps: - - uses: styfle/cancel-workflow-action@0.9.1 - with: - workflow_id: 872925,1013614,1134055 - access_token: ${{ github.token }} diff --git a/.github/workflows/proto-docker.yml b/.github/workflows/proto-docker.yml index 67480d5d6b..83dbd38bc3 100644 --- a/.github/workflows/proto-docker.yml +++ b/.github/workflows/proto-docker.yml @@ -7,6 +7,9 @@ on: paths: - "contrib/devtools/dockerfile" +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/release-sims.yml b/.github/workflows/release-sims.yml index 457eae3292..02726e7e82 100644 --- a/.github/workflows/release-sims.yml +++ b/.github/workflows/release-sims.yml @@ -30,6 +30,7 @@ jobs: test-sim-multi-seed-long: runs-on: ubuntu-latest needs: [build, install-runsim] + timeout-minutes: 60 steps: - uses: actions/checkout@v3 - uses: actions/cache@v2.1.7 diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index b2752ebe4e..ba7c4b7eef 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -8,6 +8,13 @@ on: - master jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" build: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'skip-sims')" @@ -39,6 +46,7 @@ jobs: test-sim-nondeterminism: runs-on: ubuntu-latest needs: [build, install-runsim] + timeout-minutes: 60 steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 @@ -65,6 +73,7 @@ jobs: test-sim-import-export: runs-on: ubuntu-latest needs: [build, install-runsim] + timeout-minutes: 60 steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 @@ -93,6 +102,7 @@ jobs: test-sim-after-import: runs-on: ubuntu-latest needs: [build, install-runsim] + timeout-minutes: 60 steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 @@ -121,6 +131,7 @@ jobs: test-sim-multi-seed-short: runs-on: ubuntu-latest needs: [build, install-runsim] + timeout-minutes: 60 steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 diff --git a/.github/workflows/test-race.yml b/.github/workflows/test-race.yml index 31e8fdbe73..2036ed406a 100644 --- a/.github/workflows/test-race.yml +++ b/.github/workflows/test-race.yml @@ -6,7 +6,19 @@ on: push: branches: - master + +permissions: + contents: read + jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" + install-tparse: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b55fd8c96..d310fa346b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,18 @@ on: push: branches: - master + +permissions: + contents: read + jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" build: runs-on: ubuntu-latest strategy: