Skip to content

Commit 10f54f0

Browse files
authored
Merge pull request #2 from Golem-Base/rvdp/ci
ci: try to run op-geth as a service container
2 parents c5310bb + 0ebaf87 commit 10f54f0

1 file changed

Lines changed: 40 additions & 31 deletions

File tree

.github/workflows/example.yml

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,50 @@ jobs:
1111
run-python-example:
1212
runs-on: ubuntu-latest
1313

14-
steps:
15-
- uses: actions/checkout@v4
16-
17-
- uses: cachix/install-nix-action@v31
14+
#services:
15+
# gb-op-geth:
16+
# image: "quay.io/golemnetwork/gb-op-geth:latest"
17+
# ports:
18+
# - 8545:8545
19+
# options: |
1820

19-
- uses: actions/setup-go@v5
21+
steps:
22+
- name: Run a gb-op-geth container
23+
run: >
24+
docker run -d -p 8545:8545 -e GITHUB_ACTIONS=true -e CI=true
25+
quay.io/golemnetwork/gb-op-geth:latest --dev --http --http.api
26+
'eth,web3,net,debug,golembase' --verbosity 3 --http.addr '0.0.0.0' --http.port 8545
27+
--http.corsdomain '*' --http.vhosts '*' --ws --ws.addr '0.0.0.0' --ws.port 8545
28+
29+
- name: Check out the SDK repo
30+
uses: actions/checkout@v4
31+
32+
- name: Check out the gb-op-geth repo
33+
uses: actions/checkout@v4
2034
with:
21-
go-version: "1.24.2"
22-
23-
- run: sudo apt-get update && sudo apt-get install -y docker-compose
24-
25-
- run: git clone https://github.com/Golem-Base/golembase-op-geth.git
35+
repository: Golem-Base/golembase-op-geth
36+
path: gb-op-geth
2637

27-
- run: docker-compose up -d
28-
working-directory: ./golembase-op-geth
38+
- name: Install Nix
39+
uses: cachix/install-nix-action@v31
2940

30-
- run: |
31-
go install github.com/Golem-Base/golembase-demo-cli@latest
32-
echo "$HOME/go/bin" >> $GITHUB_PATH
33-
34-
- run: |
35-
ADDRESS=$(golembase-demo-cli account create | grep -oE '0x[a-fA-F0-9]{40}')
36-
echo "ADDRESS=$ADDRESS" >> $GITHUB_ENV
37-
38-
- run: |
39-
curl 'https://faucet.golembase.demo.golem-base.io/api/faucet' \
40-
-H 'Content-Type: application/json' \
41-
--data-raw "{\"address\":\"$ADDRESS\"}"
42-
golembase-demo-cli account balance
43-
44-
- run: nix build .#golem-base-sdk-example --no-write-lock-file
41+
- name: Set up Go
42+
uses: actions/setup-go@v5
43+
with:
44+
go-version-file: "gb-op-geth/go.mod"
45+
cache-dependency-path: |
46+
gb-op-geth/go.sum
47+
48+
- name: Create and fund an account
49+
run: |
50+
go run ./cmd/golembase account create
51+
go run ./cmd/golembase account fund
52+
working-directory: ./gb-op-geth
53+
54+
- name: Build the example SDK app
55+
run: nix build .#golem-base-sdk-example --no-write-lock-file
4556
working-directory: ./example
4657

47-
- run: ./result/bin/main --instance local
58+
- name: Run the example SDK app
59+
run: ./result/bin/main --instance local
4860
working-directory: ./example
49-
50-
- run: docker-compose down
51-
working-directory: ./golembase-op-geth

0 commit comments

Comments
 (0)