Skip to content

Commit

Permalink
ci: fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 committed Oct 21, 2024
1 parent 8eca71c commit 71d2507
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/slither-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,26 @@ jobs:
with:
go-version: "1.19"

- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: "1.19"

- name: Setup external packages
run: |
sudo apt-get update
sudo apt-get install -y jq
sudo apt-get install -y gcc
sudo apt-get install -y wget
sudo wget https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 -O /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install package with soldeer
run: forge soldeer install

- name: Setup repo
run: |
chmod +x ./install.sh
./install.sh
id: setup-repo

- name: Install Slither for security analysis
run: |
sudo apt-get update
Expand Down
19 changes: 10 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,37 @@ fi
# Check if jq is installed
if ! command -v jq &>/dev/null; then
# Install jq
sudo apt-get install jq
brew install jq
fi

# Check if yq is installed
if ! command -v yq &>/dev/null; then
curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq &&
sudo chmod +x /usr/bin/yq
brew install -y wget
sudo wget https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 -O /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq
fi

# Check if gvm is installed
if ! command -v go &>/dev/null; then
if ! command -v gvm &>/dev/null; then
# Install bison
sudo apt-get install bison
brew install bison
# Install gvm
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
# Source gvm script
source $HOME/.gvm/scripts/gvm
sudo apt-get install bsdmainutils
brew install bsdmainutils

# Install go1.19
gvm install go1.19 -B
fi

rm -rf temp && mkdir temp && cd temp

git clone https://github.com/ronin-chain/ronin-random-beacon.git && cd ronin-random-beacon
rm -rf temp && mkdir temp && cd temp && git clone https://github.com/ronin-chain/ronin-random-beacon.git && cd ronin-random-beacon

# Check if installed gvm
if ! command -v gvm &>/dev/null; then
gvm use go1.19
fi

go build -o ronin-random-beacon && cp ronin-random-beacon ../../bin/ && cd ../../ && rm -rf temp

echo "Installed successfully!"

0 comments on commit 71d2507

Please sign in to comment.