From 965d55c8eba451b0128be8d720dde117d7675b48 Mon Sep 17 00:00:00 2001 From: Marko Date: Wed, 25 May 2022 17:42:55 +0200 Subject: [PATCH] chore: cache dependencies (#12043) ## Description Closes: #10471 cache dependencies to speed up ci --- ### 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/main/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/main/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/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/lint.yml | 18 +++++++++ .github/workflows/test-race.yml | 16 ++++++++ .github/workflows/test.yml | 67 +++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 056f53b1ad..b16c95f7f9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,6 +22,24 @@ jobs: **/**.go go.mod go.sum + - name: Get data from build cache + uses: actions/cache@v2 + with: + # In order: + # * Module download cache + # * Linter cache (Linux) + # * Build cache (Linux) + # * Build cache (Mac) + # * Build cache (Windows) + path: | + ~/go/pkg/mod + ~/.cache/golangci-lint + ~/.cache/go-build + ~/Library/Caches/go-build + ~\AppData\Local\go-build + key: ${{ runner.os }}-go-linter-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-linter-${{ matrix.go-version }}- - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/.github/workflows/test-race.yml b/.github/workflows/test-race.yml index 1b92805875..9307e82c3c 100644 --- a/.github/workflows/test-race.yml +++ b/.github/workflows/test-race.yml @@ -101,6 +101,22 @@ jobs: **/**.go go.mod go.sum + - name: Get data from build cache + uses: actions/cache@v2 + with: + # In order: + # * Module download cache + # * Build cache (Linux) + # * Build cache (Mac) + # * Build cache (Windows) + path: | + ~/go/pkg/mod + ~/.cache/go-build + ~/Library/Caches/go-build + ~\AppData\Local\go-build + key: ${{ runner.os }}-go-race-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-race-${{ matrix.go-version }}- - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-${{ matrix.part }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5234cc89e..a5d5f0cbec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,6 +112,24 @@ jobs: **/**.go go.mod go.sum + - name: Get data from build cache + uses: actions/cache@v2 + with: + # In order: + # * Module download cache + # * Linter cache (Linux) + # * Build cache (Linux) + # * Build cache (Mac) + # * Build cache (Windows) + path: | + ~/go/pkg/mod + ~/.cache/golangci-lint + ~/.cache/go-build + ~/Library/Caches/go-build + ~\AppData\Local\go-build + key: ${{ runner.os }}-go-linter-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-linter-${{ matrix.go-version }}- - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-${{ matrix.part }}" @@ -189,6 +207,23 @@ jobs: **/**.go go.mod go.sum + - name: Get data from build cache + uses: actions/cache@v2 + with: + # In order: + # * Module download cache + # * Build cache (Linux) + # * Build cache (Mac) + # * Build cache (Windows) + path: | + ~/go/pkg/mod + ~/.cache/golangci-lint + ~/.cache/go-build + ~/Library/Caches/go-build + ~\AppData\Local\go-build + key: ${{ runner.os }}-go-rosetta-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-rosetta-${{ matrix.go-version }}- - name: test rosetta run: | make test-rosetta @@ -209,6 +244,22 @@ jobs: **/**.go go.mod go.sum + - name: Get data from build cache + uses: actions/cache@v2 + with: + # In order: + # * Module download cache + # * Build cache (Linux) + # * Build cache (Mac) + # * Build cache (Windows) + path: | + ~/go/pkg/mod + ~/.cache/go-build + ~/Library/Caches/go-build + ~\AppData\Local\go-build + key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ matrix.go-version }}- - name: start localnet run: | make clean localnet-start @@ -250,6 +301,22 @@ jobs: **/**.go go.mod go.sum + - name: Get data from build cache + uses: actions/cache@v2 + with: + # In order: + # * Module download cache + # * Build cache (Linux) + # * Build cache (Mac) + # * Build cache (Windows) + path: | + ~/go/pkg/mod + ~/.cache/go-build + ~/Library/Caches/go-build + ~\AppData\Local\go-build + key: ${{ runner.os }}-go-sim-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-sim-${{ matrix.go-version }}- - uses: actions/cache@v3 with: path: ~/go/bin