Skip to content

Commit

Permalink
ci: use cache for based on the go.sum for dependencies for faster GH …
Browse files Browse the repository at this point in the history
…action execution (#1653)

* test: refactors cli.network suites with 'Integration' to use common function

* change log

* linter

* test fix to use correct bech32 prefix

* test: make it so that simulations don't need to be fitered for explicitly

* test(simapp): flag retrieval must be inside the  fn

* Squashed commit of the following:

commit 5a0347a
Author: Unique-Divine <[email protected]>
Date:   Sat Oct 28 16:57:44 2023 -0500

    test(simapp): flag retrieval must be inside the  fn

commit 65d43d3
Author: Unique-Divine <[email protected]>
Date:   Sat Oct 28 16:43:33 2023 -0500

    test: make it so that simulations don't need to be fitered for explicitly

commit 932cfac
Author: Unique-Divine <[email protected]>
Date:   Sat Oct 28 16:17:50 2023 -0500

    test fix to use correct bech32 prefix

commit 484e0b2
Merge: de8acbf 43e3afd
Author: Unique-Divine <[email protected]>
Date:   Fri Oct 27 17:38:14 2023 -0500

    Merge branch 'realu/consistent-integration-suite' of https://github.com/NibiruChain/nibiru into realu/consistent-integration-suite

commit de8acbf
Author: Unique-Divine <[email protected]>
Date:   Fri Oct 27 17:38:03 2023 -0500

    linter

commit 43e3afd
Merge: 6a1a459 68d4d57
Author: Unique Divine <[email protected]>
Date:   Fri Oct 27 17:13:51 2023 -0500

    Merge branch 'master' into realu/consistent-integration-suite

commit 6a1a459
Author: Unique-Divine <[email protected]>
Date:   Fri Oct 27 17:03:05 2023 -0500

    change log

commit c2028d3
Author: Unique-Divine <[email protected]>
Date:   Fri Oct 27 16:57:55 2023 -0500

    test: refactors cli.network suites with 'Integration' to use common function

* typo: Update cases.go

* ci: use cache for based on the go.sum for dependencies for faster GH action execution

* ci: add name field

* ci: fix indentation

* wip! try without go mod cache

* ci: use actions/cache@v3

* test(cases.go)

---------

Co-authored-by: Jonathan Gimeno <[email protected]>
  • Loading branch information
Unique-Divine and jgimeno authored Nov 1, 2023
1 parent 162fd05 commit 4a8c848
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 3 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
paths: ["**.go", "**.proto", "go.mod", "go.sum"]

# Allow concurrent runs on main/release branches but isolates other branches
# Allow concurrent runs on main/release branches but isolates other branches
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
Expand All @@ -28,6 +28,26 @@ jobs:
go-version: 1.19
cache: false # the golangci-lint action already caches for us (https://github.com/golangci/golangci-lint-action#performance)

# Use GitHub actions output paramters to get go paths. For more info, see
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
- name: "Set output variables for go cache"
id: go-cache-paths
run: |
echo "go-build-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: "Go build cache"
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-build-cache }}
key: go-build-cache-${{ hashFiles('**/go.sum') }}

- name: "Go mod cache"
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod-cache }}
key: go-mod-cache-${{ hashFiles('**/go.sum') }}

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,28 @@ jobs:
go-version: 1.19
cache: true

- name: Run all integration tests.
# Use GitHub actions output paramters to get go paths. For more info, see
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
- name: "Set output variables for go cache"
id: go-cache-paths
run: |
echo "go-build-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: "Go build cache"
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-build-cache }}
key: go-build-cache-${{ hashFiles('**/go.sum') }}

- name: "Go mod cache"
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod-cache }}
key: go-mod-cache-${{ hashFiles('**/go.sum') }}

- name: "Run all integration tests."
run: make test-coverage-integration

- name: Upload coverage reports to Codecov
- name: "Upload coverage reports to Codecov"
uses: codecov/codecov-action@v3
20 changes: 20 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ jobs:
go-version: 1.19
cache: true

# Use GitHub actions output paramters to get go paths. For more info, see
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
- name: "Set output variables for go cache"
id: go-cache-paths
run: |
echo "go-build-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: "Go build cache"
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-build-cache }}
key: go-build-cache-${{ hashFiles('**/go.sum') }}

- name: "Go mod cache"
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod-cache }}
key: go-mod-cache-${{ hashFiles('**/go.sum') }}

- name: Run all unit tests.
run: make test-unit

Expand Down

0 comments on commit 4a8c848

Please sign in to comment.