Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services/horizon: Migrate integration tests to GitHub Actions #4242

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/horizon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Horizon

on:
push:
branches: [master]
pull_request:

jobs:

integration:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.17]
pg: [9.6.5]
ingestion-backend: [db, captive-core, captive-core-remote-storage]
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:${{ matrix.pg }}
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
HORIZON_INTEGRATION_TESTS: "true"
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Pull latest Stellar Core image
run: docker pull stellar/stellar-core
- if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }}
name: Install and enable Captive Core
env:
CAPTIVE_CORE_VERSION: 18.0.3-746.f3baea6.focal
run: |
sudo wget -qO - https://apt.stellar.org/SDF.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=true sudo apt-key add -
sudo bash -c 'echo "deb https://apt.stellar.org focal unstable" > /etc/apt/sources.list.d/SDF-unstable.list'
sudo apt-get update && sudo apt-get install -y stellar-core=$CAPTIVE_CORE_VERSION
echo "Using stellar core version $(stellar-core version)"
echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE=true' >> $GITHUB_ENV
echo 'CAPTIVE_CORE_BIN=/usr/bin/stellar-core' >> $GITHUB_ENV
- if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }}
name: Setup Captive Core Remote Storage
run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV
- run: go test -race -timeout 25m -v ./services/horizon/internal/integration/...