Skip to content

Commit

Permalink
ci: fix build test (#904)
Browse files Browse the repository at this point in the history
* testing ci

* testing ci

* optional alpine test + limited concurrency

* testing ci

* testing ci

* testing ci

* testing ci

* testing ci

* testing ci

* Skippig cache on linter

* Added automatic retry

* moved to zeta runners

* added sleep timer

* Testing test with sleep

* Updated linter

* Updated linter action version

* adjusted max attempts

---------

Co-authored-by: brewmaster012 <[email protected]>
  • Loading branch information
CharlieMc0 and brewmaster012 authored Aug 7, 2023
1 parent 4b9d98f commit 6753c10
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 20 deletions.
59 changes: 41 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- ready_for_review

concurrency:
group: ${{ github.head_ref || github.run_id }}
group: build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
Expand All @@ -30,8 +30,11 @@ env:
jobs:
build-and-test-single-arch:
runs-on: ubuntu-latest
# runs-on: ["zeta-runners"]
timeout-minutes: 20
if: (! startsWith(github.ref, 'refs/tags/')) || (! startsWith(github.ref, 'refs/heads/develop') )
concurrency:
group: "build-and-test-single-arch"
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -60,12 +63,17 @@ jobs:
uses: de-vri-es/[email protected]
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

- name: Test
run: |
echo "Running Build Tests"
make clean
make test
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 2
retry_on: error
command: |
echo "Running Build Tests"
make clean
make test
- name: Build zetacored and zetaclientd
env:
Expand Down Expand Up @@ -136,10 +144,15 @@ jobs:
# ${{ matrix.runs-on }}-go-

- name: Test
run: |
echo "Running Build Tests"
make clean
make test
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 2
retry_on: error
command: |
echo "Running Build Tests"
make clean
make test
- name: Build zetacored and zetaclientd
env:
Expand Down Expand Up @@ -227,13 +240,25 @@ jobs:
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

# - name: Test
# shell: alpine.sh --root {0}
# run: |
# echo "Running Build Tests"
# apk add --no-cache --update
# make clean
# make test

- name: Test
shell: alpine.sh --root {0}
run: |
echo "Running Build Tests"
apk add --no-cache --update
make clean
make test
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 2
retry_on: error
shell: alpine.sh --root {0}
command: |
echo "Running Build Tests"
make clean
make test
- name: Build zetacored and zetaclientd
env:
Expand All @@ -247,8 +272,6 @@ jobs:
make install-testnet
cp "$HOME"/go/bin/* ./
- name: Binary Docker Test
env:
CPU_ARCH: ${{ env.CPU_ARCH }}
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ on:

env:
GOPRIVATE: github.com/zeta-chain/*


concurrency:
group: linters-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10

env:
GO111MODULE: on
Expand All @@ -32,6 +37,9 @@ jobs:
go-version: 1.19

- name: Run golangci-lint
uses: golangci/[email protected]
uses: golangci/golangci-lint-action@v3

with:
version: v1.50
skip-cache: false

3 changes: 3 additions & 0 deletions x/crosschain/client/integrationtests/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package integrationtests

import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
ethcfg "github.com/evmos/ethermint/cmd/config"
"github.com/stretchr/testify/suite"
Expand Down Expand Up @@ -54,6 +56,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
net, err := network.New(s.T(), app.NodeDir, s.cfg)
s.Assert().NoError(err)
s.network = net
time.Sleep(3 * time.Second)
_, err = s.network.WaitForHeight(1)
s.Require().NoError(err)

Expand Down

0 comments on commit 6753c10

Please sign in to comment.