Skip to content

Commit

Permalink
Improve API limiting and cache
Browse files Browse the repository at this point in the history
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
  • Loading branch information
azeemshaikh38 committed Sep 22, 2022
1 parent f017e2e commit 10f74c7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/docker.yml
Expand Up @@ -49,6 +49,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 #v2.1.7
Expand All @@ -75,6 +76,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: docker build
run: make scorecard-docker
cron-controller:
Expand All @@ -92,6 +94,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 #v2.1.7
Expand All @@ -118,6 +121,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: docker build
run: make cron-controller-docker
cron-worker:
Expand All @@ -135,6 +139,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 #v2.1.7
Expand All @@ -161,6 +166,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: docker build
run: make cron-worker-docker
cron-cii-worker:
Expand All @@ -178,6 +184,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 #v2.1.7
Expand All @@ -204,6 +211,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: docker build
run: make cron-cii-worker-docker
cron-bq-transfer:
Expand All @@ -221,6 +229,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 #v2.1.7
Expand All @@ -247,6 +256,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: docker build
run: make cron-bq-transfer-docker
cron-webhook:
Expand All @@ -264,6 +274,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 #v2.1.7
Expand All @@ -290,6 +301,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: docker build
run: make cron-webhook-docker
cron-github-server:
Expand All @@ -307,6 +319,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 #v2.1.7
Expand All @@ -333,5 +346,6 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: docker build
run: make cron-github-server-docker
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Expand Up @@ -62,6 +62,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: Run unit-tests
run: make unit-test
- name: Upload codecoverage
Expand Down Expand Up @@ -106,6 +107,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: generate mocks
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -131,6 +133,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -152,6 +155,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: generate docs
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -176,6 +180,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Clone the code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2.3.4
with:
Expand All @@ -185,6 +190,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build-proto
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -210,6 +216,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -231,6 +238,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: Run build
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -256,6 +264,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -277,6 +286,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build cron
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -302,6 +312,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -323,6 +334,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build worker
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -348,6 +360,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -369,6 +382,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build cii-worker
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -394,6 +408,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -415,6 +430,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build shuffler
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -440,6 +456,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -461,6 +478,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build bq transfer
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -486,6 +504,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -507,6 +526,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build bq transfer
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -532,6 +552,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -553,6 +574,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build webhook
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -578,6 +600,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -599,6 +622,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build-add-script
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -624,6 +648,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -645,6 +670,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build-validate-script
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -670,6 +696,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -691,6 +718,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build-validate-script
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -715,6 +743,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Clone the code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2.3.4
with:
Expand All @@ -724,6 +753,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: Run build
run: |
go env -w GOFLAGS=-mod=mod
Expand Down Expand Up @@ -760,6 +790,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: Run build
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -784,6 +815,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache builds
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2.1.7
Expand All @@ -805,6 +837,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: Run build
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -829,6 +862,7 @@ jobs:
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Clone the code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2.3.4
with:
Expand All @@ -838,6 +872,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: Run build
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f
with:
Expand All @@ -863,6 +898,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: Check license headers
run: |
go env -w GOFLAGS=-mod=mod
Expand Down

0 comments on commit 10f74c7

Please sign in to comment.