diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 372f8a1bc5..efa8843cb9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index e8f08d40e1..8e451b0595 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 97e5cd7b1d..c0df3b985e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/price-feeder-release.yml b/.github/workflows/price-feeder-release.yml index e14535cb0b..a7cb6ee90e 100644 --- a/.github/workflows/price-feeder-release.yml +++ b/.github/workflows/price-feeder-release.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e093e3be89..6980c63c66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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 diff --git a/.github/workflows/simulations.yml b/.github/workflows/simulations.yml index dc78abc67f..5d2a1c8964 100644 --- a/.github/workflows/simulations.yml +++ b/.github/workflows/simulations.yml @@ -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/runsim@v1.0.0 - uses: actions/cache@v3 @@ -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 @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 361b7add0c..96927681f0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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/tparse@v0.8.3 - 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/tparse@v0.9.0 test-unit-cover: runs-on: ubuntu-latest @@ -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 @@ -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 @@ -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 @@ -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/starport@v0.19.5! | bash