Skip to content

Commit

Permalink
chore: speedup Github CI by adding more cache (#949)
Browse files Browse the repository at this point in the history
## Description

Related to: https://github.com/osmosis-labs/osmosis/pull/1583/files and old task I had in the Cosmos SDK (cosmos/cosmos-sdk#10471)

----

### 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 appropriate labels to the PR
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/umee-network/umee/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] 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)
  • Loading branch information
robert-zaremba authored May 25, 2022
1 parent 45096f4 commit b992fd6
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ jobs:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}

- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}

- name: Compile
run: |
go mod download
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}

- uses: actions/checkout@v3
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
**/**.go
go.mod
go.sum
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
- name: Run golangci-lint
run: make lint
if: env.GIT_DIFF
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/price-feeder-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
# Parse 'v*.*.*' semantic version from 'price-feeder/v*.*.*' and save to
# the $GITHUB_ENV environment variable.
- name: Set env
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- "v[0-9]+\\.[0-9]+\\.[0-9]+" # Official release version tags e.g. v2.0.5
- "v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+" # Release candidate tags e.g. v1.0.3-rc4
pull_request:
types: [ opened, synchronize ]
types: [opened, synchronize]

jobs:
release:
Expand All @@ -19,7 +19,17 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.17
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF

- name: Set Env
run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV
- name: Build
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/simulations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}

- name: Install runsim
run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/cache@v3
Expand All @@ -41,6 +50,15 @@ jobs:
**/**.go
go.mod
go.sum
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
- name: Test application non-determinism
run: |
make test-sim-non-determinism
Expand All @@ -60,6 +78,15 @@ jobs:
**/**.go
go.mod
go.sum
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand Down
44 changes: 41 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ jobs:
go-version: 1.17
- name: Display Go Version
run: go version
- name: Install tparse
run: |
export GO111MODULE="on" && go get github.com/mfridman/[email protected]
- uses: actions/cache@v3
id: cache-go-tpares
with:
path: ~/go/bin
key: ${{ runner.os }}-go-tparse-binary
- name: Install tparse
if: steps.cache-go-tpares.outputs.cache-hit != 'true'
run: |
export GO111MODULE="on" && go get github.com/mfridman/[email protected]
test-unit-cover:
runs-on: ubuntu-latest
Expand All @@ -44,6 +46,15 @@ jobs:
**/**.go
go.mod
go.sum
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
- name: Test and Create Coverage Report
run: |
make test-unit-cover
Expand All @@ -68,6 +79,15 @@ jobs:
**/**.go
go.mod
go.sum
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
- name: Build Docker Image
run: |
make docker-build-debug
Expand All @@ -90,6 +110,15 @@ jobs:
**/**.go
price-feeder/go.mod
price-feeder/go.sum
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
- name: Test price-feeder
run: |
cd price-feeder && make test-unit
Expand All @@ -110,6 +139,15 @@ jobs:
**/**.go
go.mod
go.sum
- name: Get Go Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
- name: Install Starport
run: |
curl https://get.starport.network/[email protected]! | bash
Expand Down

0 comments on commit b992fd6

Please sign in to comment.