Skip to content

Commit

Permalink
ci: Reduce the number of API calls made (#869)
Browse files Browse the repository at this point in the history
This is an attempt at reducing the rate limit hits.
  • Loading branch information
theofidry authored Feb 11, 2023
1 parent c98c488 commit 1ee7d39
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ on:
release:
types: [ created ]

env:
POLLING_INTERVALS_SEC: 30
SLEEP_TIME_SEC: 60s

jobs:
wait-for-phar-and-docker-images:
runs-on: ubuntu-latest
name: Wait for the PHAR & Docker images
steps:
# Reduce the amount polling done without increasing the polling internal too much.
- name: Sleep
run: sleep ${{ env.SLEEP_TIME_SEC }}
shell: bash

# I could not make this workflow work with a on.workflow_run. Hence instead of adding this
# wait step for _every_ e2e job, which will block more runners, we wait in one and only one
# runner.
Expand All @@ -21,15 +30,15 @@ jobs:
checkName: Build PHAR
ref: ${{ github.event.pull_request.head.sha || github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
intervalSeconds: 10
intervalSeconds: ${{ env.POLLING_INTERVALS_SEC }}

- name: Wait for the Docker images to be pushed
uses: fountainhead/action-wait-for-check@v1.1.0
with:
checkName: Docker status
ref: ${{ github.event.pull_request.head.sha || github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
intervalSeconds: 10
intervalSeconds: ${{ env.POLLING_INTERVALS_SEC }}

e2e-tests:
runs-on: ubuntu-latest
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/requirement-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches: [ main ]
pull_request: ~

env:
POLLING_INTERVALS_SEC: 30
SLEEP_TIME_SEC: 60s

jobs:
cs-lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -143,6 +147,11 @@ jobs:
runs-on: ubuntu-latest
name: Wait for the PHAR & Docker images
steps:
# Reduce the amount polling done without increasing the polling internal too much.
- name: Sleep
run: sleep ${{ env.SLEEP_TIME_SEC }}
shell: bash

# I could not make this workflow work with a on.workflow_run. Hence instead of adding this
# wait step for _every_ e2e job, which will block more runners, we wait in one and only one
# runner.
Expand All @@ -152,15 +161,15 @@ jobs:
checkName: Build PHAR
ref: ${{ github.event.pull_request.head.sha || github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
intervalSeconds: 10
intervalSeconds: ${{ env.POLLING_INTERVALS_SEC }}

- name: Wait for the Docker images to be pushed
uses: fountainhead/action-wait-for-check@v1.1.0
with:
checkName: Docker status
ref: ${{ github.event.pull_request.head.sha || github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
intervalSeconds: 10
intervalSeconds: ${{ env.POLLING_INTERVALS_SEC }}

e2e-tests:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 1ee7d39

Please sign in to comment.