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 <[email protected]>
  • Loading branch information
troian committed Sep 27, 2024
1 parent dce81bf commit da693b8
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 25 deletions.
9 changes: 9 additions & 0 deletions .apt-packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pv
lz4
git-cliff
npm
jq
curl
unzip
wget
make
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
4 changes: 3 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: xargs -ar .apt-packages.txt sudo apt install -y
- 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: self-hosted1
needs:
- publish
steps:
Expand Down
22 changes: 19 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: xargs -ar .apt-packages.txt sudo apt install -y
- 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: xargs -ar .apt-packages.txt sudo apt install -y
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -82,6 +86,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install dependencies
run: |
apt install -y pv lz4 git-cliff
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -101,6 +108,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install dependencies
run: xargs -ar .apt-packages.txt sudo apt install -y
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -119,6 +128,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
- name: Install dependencies
run: xargs -ar .apt-packages.txt sudo apt install -y
- run: git fetch --prune --unshallow
- name: Detect required Go version
run: |
Expand All @@ -140,6 +152,8 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v4
- name: Install dependencies
run: xargs -ar .apt-packages.txt sudo apt install -y
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -165,6 +179,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install dependencies
run: xargs -ar .apt-packages.txt sudo apt install -y
- name: Detect required Go version
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
Expand All @@ -189,7 +205,7 @@ jobs:
run: make release

network-upgrade-names:
runs-on: upgrade-tester
runs-on: self-hosted1
steps:
- name: Cleanup build folder
run: |
Expand Down Expand Up @@ -222,7 +238,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: self-hosted1
steps:
- name: Cleanup build folder
run: |
Expand Down
2 changes: 2 additions & 0 deletions make/test-upgrade.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ UPGRADE_BINARY_VERSION ?= local
REMOTE_TEST_WORKDIR ?= ~/go/src/github.com/akash-network/node
REMOTE_TEST_HOST ?=

COSMOVISOR := /Users/amr/go/src/github.com/cosmos/cosmos-sdk/tools/cosmovisor/cosmovisor

$(AKASH_INIT):
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --gbv=$(GENESIS_BINARY_VERSION) --ufrom=$(UPGRADE_FROM) --uto=$(UPGRADE_TO) --config="$(PWD)/config.json" init
touch $@
Expand Down
15 changes: 1 addition & 14 deletions script/upgrades.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,6 @@ function init() {
cp "$validators_dir/.akash0/cosmovisor/upgrades/$UPGRADE_TO/bin/akash" "$upgrade_bin/akash"
fi

pushd "$(pwd)"
cd "$cosmovisor_dir"

ln -snf "current" "genesis"

popd

AKASH=$genesis_bin/akash

$AKASH init --home "$valdir" "$(jq -rc '.moniker' <<<"$val")" >/dev/null 2>&1
Expand All @@ -286,6 +279,7 @@ function init() {

tar_cmd=$(content_type "$(content_name "$GENESIS_ORIG")")

# shellcheck disable=SC2086
wget -nv -O - "$GENESIS_ORIG" | pv $pv_args | eval "$tar_cmd"
else
echo "unable to download genesis"
Expand Down Expand Up @@ -441,13 +435,6 @@ function bins() {
cp "$validators_dir/.akash0/cosmovisor/upgrades/$UPGRADE_TO/bin/akash" "$upgrade_bin/akash"
fi

pushd "$(pwd)"
cd "$cosmovisor_dir"

ln -snf "genesis" "current"

popd

((cnt++)) || true
done
}
Expand Down
7 changes: 0 additions & 7 deletions tests/upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,6 @@ func TestUpgrade(t *testing.T) {
fail = true
}
}

// select {
// case errs := <-vl.testErrsCh:
//
//
// case <-vl.ctx.Done():
// }
}

if fail {
Expand Down

0 comments on commit da693b8

Please sign in to comment.