Skip to content

gha integration tests #5

gha integration tests

gha integration tests #5

Workflow file for this run

name: (g)RPC Integration Tests
on:
push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
# workflow_dispatch:
env:
GO_VERSION: '1.23'
NODE_VERSION: '20'
RUST_VERSION: 'stable'
EPOCH: 0
GRPC_CURL_VERSION: '1.8.9'
jobs:
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libssl-dev \
pkg-config \
protobuf-compiler \
aria2
- name: Install grpcurl
run: |
wget -q https://github.com/fullstorydev/grpcurl/releases/download/v${{ env.GRPC_CURL_VERSION }}/grpcurl_${{ env.GRPC_CURL_VERSION }}_linux_x86_64.tar.gz
tar -xzf grpcurl_${{ env.GRPC_CURL_VERSION }}_linux_x86_64.tar.gz
sudo mv grpcurl /usr/local/bin/
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go dependencies
run: go mod download
- name: Build faithful-cli binary
run: make
- name: Download epoch 0 indexes and prepare config file
run: |
HOSTNAME=https://files.old-faithful.net
EPOCH=${{ env.EPOCH }}
BAFY=$(curl $HOSTNAME/$EPOCH/epoch-$EPOCH.cid -s)
INDEX_FOLDER=/tmp/epoch0
INDEXES=(cid-to-offset-and-size slot-to-blocktime sig-to-cid sig-exists slot-to-cid)
for INDEX in "${INDEXES[@]}"; do
aria2c -x 16 -s 16 -q -d $INDEX_FOLDER \
"$HOSTNAME/$EPOCH/epoch-$EPOCH-$BAFY-mainnet-$INDEX.index"
done
wget -q -O $INDEX_FOLDER/genesis.tar.bz2 https://api.mainnet-beta.solana.com/genesis.tar.bz2
cat << EOF > /tmp/$EPOCH.yml
epoch: $EPOCH
version: 1
data:
car:
uri: https://files.old-faithful.net/$EPOCH/epoch-$EPOCH.car
filecoin:
enable: false
genesis:
uri: $INDEX_FOLDER/genesis.tar.bz2
indexes:
cid_to_offset_and_size:
uri: $(ls $INDEX_FOLDER/epoch-$EPOCH-$BAFY-mainnet-cid-to-offset-and-size.index)
slot_to_cid:
uri: $(ls $INDEX_FOLDER/epoch-$EPOCH-$BAFY-mainnet-slot-to-cid.index)
slot_to_blocktime:
uri: $(ls $INDEX_FOLDER/epoch-$EPOCH-$BAFY-mainnet-slot-to-blocktime.index)
sig_to_cid:
uri: $(ls $INDEX_FOLDER/epoch-$EPOCH-$BAFY-mainnet-sig-to-cid.index)
sig_exists:
uri: $(ls $INDEX_FOLDER/epoch-$EPOCH-$BAFY-mainnet-sig-exists.index)
EOF
cat /tmp/$EPOCH.yml
ls -lha /tmp/epoch0
- name: Start faithful-cli server
uses: JarvusInnovations/background-action@v1
with:
run: ./bin/faithful-cli rpc --listen ":7999" --grpc-listen ":8999" --watch /tmp/$EPOCH.yml
wait-on: |
http://localhost:7999
http-get://localhost:7999/health
wait-for: 5s
- name: Run gRPC tests
run: |
grpcurl -plaintext -proto ./old-faithful-proto/old-faithful-grpc.proto localhost:8999 list