Skip to content

Commit

Permalink
fix(lint): shell lint
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <troian.ap@gmail.com>
  • Loading branch information
troian committed Sep 30, 2024
1 parent dce81bf commit 459604c
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 154 deletions.
15 changes: 15 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ if ! has readlink; then
exit 1
fi

if ! has pv; then
echo "pv is not installed"
exit 1
fi

if ! has lz4; then
echo "lz4 is not installed"
exit 1
fi

if ! has git-cliff; then
echo "git-cliff is not installed"
exit 1
fi

if [ -z "$GOPATH" ]; then
GOPATH=$(go env GOPATH)
export GOPATH
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install dependencies
run: ./script/tools.sh gha-deps
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand Down Expand Up @@ -47,7 +49,7 @@ jobs:
# using PAT as homebrew is located in different repo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test-network-upgrade-on-release:
runs-on: upgrade-tester
runs-on: gh-runner-test
needs:
- publish
steps:
Expand All @@ -60,6 +62,10 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GOVERSION }}"
- name: Install git-cliff
uses: baptiste0928/cargo-install@v3
with:
crate: git-cliff
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
with:
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- name: Install dependencies
run: |
brew install bash direnv
brew install bash direnv pv lz4 git-cliff
sudo chsh -s /usr/local/bin/bash
- name: Hook direnv to bash
run: echo 'eval "$(direnv hook bash)"' >> $HOME/.bashrc
Expand All @@ -44,6 +44,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install dependencies
run: ./script/tools.sh gha-deps
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -64,6 +66,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install dependencies
run: ./script/tools.sh gha-deps
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -82,6 +86,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install dependencies
run: ./script/tools.sh gha-deps
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -101,6 +107,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install dependencies
run: ./script/tools.sh gha-deps
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -119,6 +127,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./script/tools.sh gha-deps
- run: git fetch --prune --unshallow
- name: Detect required Go version
run: |
Expand All @@ -140,6 +150,8 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v4
- name: Install dependencies
run: ./script/tools.sh gha-deps
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -165,6 +177,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install dependencies
run: ./script/tools.sh gha-deps
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -189,7 +203,7 @@ jobs:
run: make release

network-upgrade-names:
runs-on: upgrade-tester
runs-on: gh-runner-test
steps:
- name: Cleanup build folder
run: |
Expand All @@ -204,6 +218,10 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GOVERSION }}"
- name: Install git-cliff
uses: baptiste0928/cargo-install@v3
with:
crate: git-cliff
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
with:
Expand All @@ -222,7 +240,7 @@ jobs:
./script/semver.sh validate "$upgrade"
done <<< $(find "$dir" ! -path "$dir" -maxdepth 1 -type d -exec basename {} \;)
network-upgrade:
runs-on: upgrade-tester
runs-on: gh-runner-test
steps:
- name: Cleanup build folder
run: |
Expand All @@ -237,6 +255,10 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GOVERSION }}"
- name: Install git-cliff
uses: baptiste0928/cargo-install@v3
with:
crate: git-cliff
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
with:
Expand Down
27 changes: 0 additions & 27 deletions make/test-upgrade.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,6 @@ test: $(COSMOVISOR) init
-upgrade-version="$(UPGRADE_BINARY_VERSION)" \
-test-cases=test-cases.json

$(COSMOVISOR_DEBUG_VERSION_FILE): $(AKASH_DEVCACHE)
@echo "installing cosmovisor for remote debug $(COSMOVISOR_VERSION) ..."
rm -f $(COSMOVISOR_DEBUG)
wget -qO- "https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor/$(COSMOVISOR_VERSION)/cosmovisor-$(COSMOVISOR_VERSION)-$(GOOS)-$(GOARCH).tar.gz" | \
tar xvz -C $(AKASH_RUN_BIN) cosmovisor
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
$(COSMOVISOR_DEBUG): $(COSMOVISOR_DEBUG_VERSION_FILE)

.PHONY: test-remote-prep
test-remote-prep: $(COSMOVISOR_DEBUG) bins
$(GO_TEST) -c -tags e2e.upgrade -timeout 60m \
-o $(AKASH_DEVCACHE_BIN)/upgrade.test \
-gcflags "all=-N -l" pkg.akt.dev/node/tests/upgrade
chmod +x $(AKASH_DEVCACHE_BIN)/upgrade.test
rsync -Pl $(AKASH_DEVCACHE_BIN)/upgrade.test $(REMOTE_TEST_HOST):$(REMOTE_TEST_WORKDIR)/
rsync -Prl --delete $(AKASH_RUN) $(REMOTE_TEST_HOST):$(REMOTE_TEST_WORKDIR)/
rsync -Pl $(AKASH_ROOT)/tests/upgrade/test-config.json $(REMOTE_TEST_HOST):$(REMOTE_TEST_WORKDIR)
rsync -Pl $(AKASH_ROOT)/tests/upgrade/test-cases.json $(REMOTE_TEST_HOST):$(REMOTE_TEST_WORKDIR)

.PHONY: test-remote-start
test-remote-start:
ssh -t $(REMOTE_TEST_HOST) 'cd $(REMOTE_TEST_WORKDIR); bash -ic "\
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./upgrade.test \
-- -test.v=test2json -test.paniconexit0 -test.run ^\QTestUpgrade\E$ -cosmovisor=$$(pwd)/bin/cosmovisor -workdir=$$(pwd)/run/upgrade/validators -config=test-config.json -upgrade-name=$(UPGRADE_TO) -upgrade-version=$(UPGRADE_BINARY_VERSION) -test-cases=test-cases.json"'

.PHONY: test-reset
test-reset:
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) clean
Expand Down
Loading

0 comments on commit 459604c

Please sign in to comment.