Skip to content

Commit 3f5f8b1

Browse files
committed
ci: fix ci
1 parent 7d40e47 commit 3f5f8b1

File tree

3 files changed

+69
-36
lines changed

3 files changed

+69
-36
lines changed

.github/workflows/slither-analyze.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fail-fast: true
2929

3030
name: Foundry project
31-
runs-on: ubuntu-latest
31+
runs-on: [self-hosted, dockerize]
3232

3333
env:
3434
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
@@ -39,6 +39,17 @@ jobs:
3939
with:
4040
submodules: recursive
4141

42+
- name: Set up Go 1.19
43+
uses: actions/setup-go@v4
44+
with:
45+
go-version: "1.19"
46+
47+
- name: Install Foundry
48+
uses: foundry-rs/foundry-toolchain@v1
49+
50+
- name: Install package with soldeer
51+
run: forge soldeer install
52+
4253
- name: Setup repo
4354
run: |
4455
chmod +x ./install.sh

.github/workflows/test.yml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,42 @@ jobs:
3131
with:
3232
submodules: recursive
3333

34-
- name: Setup repo
34+
- name: Set up Go 1.19
35+
uses: actions/setup-go@v4
36+
with:
37+
go-version: "1.19"
38+
39+
- name: Install jq
40+
run: sudo apt-get install -y jq
41+
42+
- name: Update apt-get and Install GCC
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get install -y gcc
46+
47+
- name: Install wget
48+
run: sudo apt-get install -y wget
49+
50+
- name: Install yq
51+
run: |
52+
sudo wget https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 -O /usr/local/bin/yq
53+
sudo chmod +x /usr/local/bin/yq
54+
55+
- name: Install Foundry
56+
uses: foundry-rs/foundry-toolchain@v1
57+
58+
- name: Install package with soldeer
59+
run: forge soldeer install
60+
61+
- name: Build random beacon binary
3562
run: |
36-
chmod +x ./install.sh
37-
./install.sh
38-
id: setup-repo
63+
rm -rf temp && mkdir temp && cd temp
64+
git clone https://github.com/ronin-chain/ronin-random-beacon.git
65+
cd ronin-random-beacon && ls
66+
go build -o random_beacon && ls
67+
cp ./ronin-random-beacon ../../bin/
68+
cd ../../
69+
rm -rf temp
3970
4071
- name: Run Forge build
4172
run: |

install.sh

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,50 @@
11
#!/bin/bash
22

33
# Check if foundry is installed
4-
if ! command -v $HOME/.foundry/bin/forge &>/dev/null; then
4+
if ! command -v forge &>/dev/null; then
55
# Install foundryup
66
curl -L https://foundry.paradigm.xyz | bash
77
# Install foundry
88
$HOME/.foundry/bin/foundryup
9-
fi
10-
11-
$HOME/.foundry/bin/forge soldeer update
12-
# Run forge build
13-
$HOME/.foundry/bin/forge build
149

15-
# Check if homebrew is installed
16-
if ! command -v brew &>/dev/null; then
17-
# Install homebrew
18-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
10+
$HOME/.foundry/bin/forge soldeer update
11+
# Run forge build
12+
$HOME/.foundry/bin/forge build
1913
fi
2014

2115
# Check if jq is installed
2216
if ! command -v jq &>/dev/null; then
2317
# Install jq
24-
brew install jq
18+
sudo apt-get install jq
2519
fi
2620

2721
# Check if yq is installed
2822
if ! command -v yq &>/dev/null; then
29-
# Install yq
30-
brew install yq
23+
curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq &&
24+
sudo chmod +x /usr/bin/yq
3125
fi
3226

3327
# Check if gvm is installed
34-
if ! command -v gvm &>/dev/null; then
28+
if ! command -v go &>/dev/null; then
3529
# Install bison
36-
brew install bison
30+
sudo apt-get install bison
3731
# Install gvm
3832
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
39-
fi
40-
41-
# Source gvm script
42-
source ~/.gvm/scripts/gvm
43-
# Install go1.19
44-
gvm install go1.19 -B
33+
# Source gvm script
34+
source $HOME/.gvm/scripts/gvm
35+
sudo apt-get install bsdmainutils
4536

46-
rm -rf temp
47-
mkdir temp
48-
cd temp
49-
ls
50-
51-
git clone [email protected]:ronin-chain/ronin-random-beacon.git
37+
# Install go1.19
38+
gvm install go1.19 -B
39+
fi
5240

53-
cd ronin-random-beacon
41+
rm -rf temp && mkdir temp && cd temp
5442

55-
gvm use go1.19 && go build -o ronin-random-beacon
43+
git clone https://github.com/ronin-chain/ronin-random-beacon.git && cd ronin-random-beacon
5644

57-
cp ronin-random-beacon ../../bin/ && cd ../../
45+
# Check if installed gvm
46+
if ! command -v gvm &>/dev/null; then
47+
gvm use go1.19
48+
fi
5849

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

0 commit comments

Comments
 (0)