Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/exp/services/market-…
Browse files Browse the repository at this point in the history
…tracker/github.com/prometheus/client_golang-1.11.1
  • Loading branch information
mollykarcher authored Sep 22, 2023
2 parents 51a4f72 + 838b1c4 commit 55b2b37
Show file tree
Hide file tree
Showing 366 changed files with 69,194 additions and 30,594 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
complete:
if: always()
needs: [check, build, test]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1

check:
strategy:
matrix:
os: [ubuntu-20.04]
go: [1.20.1]
os: [ubuntu-22.04]
go: ["1.20"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -37,8 +37,8 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04]
go: [1.19.6, 1.20.1]
os: [ubuntu-22.04]
go: ["1.19", "1.20"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -55,8 +55,8 @@ jobs:
test:
strategy:
matrix:
os: [ubuntu-20.04]
go: [1.19.6, 1.20.1]
os: [ubuntu-22.04]
go: ["1.19", "1.20"]
pg: [9.6.5, 10]
runs-on: ${{ matrix.os }}
services:
Expand All @@ -82,7 +82,7 @@ jobs:
--health-retries 5
ports:
- 6379:6379
env:
env:
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
golangci:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # version v3.0.2
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # version v3.2.0
with:
version: v1.51.1 # this is the golangci-lint version
version: v1.52.2 # this is the golangci-lint version
args: --issues-exit-code=0 # exit without errors for now - won't fail the build
github-token: ${{ secrets.GITHUB_TOKEN }}
only-new-issues: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/horizon-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

push-state-diff-image:
name: Push stellar/ledger-state-diff:{sha,latest} to DockerHub
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/horizon-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:

publish-artifacts:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
name: Upload artifacts to GitHub release
steps:
- name: Run deprecation tests
Expand All @@ -22,7 +22,7 @@ jobs:

- uses: ./.github/actions/setup-go
with:
go-version: 1.20.1
go-version: "1.20"

- name: Check dependencies
run: ./gomod.sh
Expand Down
211 changes: 117 additions & 94 deletions .github/workflows/horizon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ on:
pull_request:

jobs:

integration:
name: Integration tests
strategy:
matrix:
os: [ubuntu-20.04]
go: [1.19.6, 1.20.1]
os: [ubuntu-20.04, ubuntu-22.04]
go: ["1.19", "1.20"]
pg: [9.6.5]
ingestion-backend: [db, captive-core, captive-core-remote-storage]
protocol-version: [18, 19]
protocol-version: [19, 20]
runs-on: ${{ matrix.os }}
services:
postgres:
Expand All @@ -30,108 +29,132 @@ jobs:
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
- 5432:5432
env:
HORIZON_INTEGRATION_TESTS_ENABLED: true
HORIZON_INTEGRATION_TESTS_CORE_MAX_SUPPORTED_PROTOCOL: ${{ matrix.protocol-version }}
PROTOCOL_19_CORE_DEBIAN_PKG_VERSION: 19.8.0-1227.040a29c51.focal
PROTOCOL_19_CORE_DOCKER_IMG: stellar/stellar-core:19.8.0-1227.040a29c51.focal
PROTOCOL_18_CORE_DEBIAN_PKG_VERSION: 19.8.0-1227.040a29c51.focal
PROTOCOL_18_CORE_DOCKER_IMG: stellar/stellar-core:19.8.0-1227.040a29c51.focal
PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 19.13.1-1481.3acf6dd26.focal
PROTOCOL_20_CORE_DOCKER_IMG: stellar/stellar-core:19.13.1-1481.3acf6dd26.focal
PROTOCOL_20_SOROBAN_RPC_DOCKER_IMG: stellar/soroban-rpc:20.0.0-rc3-39
PROTOCOL_19_CORE_DEBIAN_PKG_VERSION: 19.14.0-1500.5664eff4e.focal
PROTOCOL_19_CORE_DOCKER_IMG: stellar/stellar-core:19.14.0-1500.5664eff4e.focal
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}
# We need to full history for git-restore-mtime to know what modification dates to use.
# Otherwise, the Go test cache will fail (due to the modification time of fixtures changing).
fetch-depth: '0'

# In order to debug the integration tests, run 'touch continue' once you connect to the ssh session
#
# - name: Setup upterm session
# uses: lhotari/action-upterm@d23c2722bdab893785c9fbeae314cbf080645bd7
# with:
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow
# limit-access-to-actor: true
# ## limits ssh access and adds the ssh public keys of the listed GitHub users
# limit-access-to-users: <yourGithubUser>

- uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.go }}

- name: Pull and set Stellar Core image
shell: bash
run: |
docker pull "$PROTOCOL_${{ matrix.protocol-version }}_CORE_DOCKER_IMG"
echo HORIZON_INTEGRATION_TESTS_DOCKER_IMG="$PROTOCOL_${{ matrix.protocol-version }}_CORE_DOCKER_IMG" >> $GITHUB_ENV
- if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }}
name: Install and enable Captive Core
run: |
# Workaround for https://github.com/actions/virtual-environments/issues/5245,
# libc++1-8 won't be installed if another version is installed (but apt won't give you a helpul
# message about why the installation fails)
sudo apt-get remove -y libc++1-10 libc++abi1-10 || true
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="$PROTOCOL_${{ matrix.protocol-version }}_CORE_DEBIAN_PKG_VERSION"
echo "Using stellar core version $(stellar-core version)"
echo 'HORIZON_INTEGRATION_TESTS_ENABLE_CAPTIVE_CORE=true' >> $GITHUB_ENV
echo 'HORIZON_INTEGRATION_TESTS_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_TESTS_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV

- name: Build Horizon reproducible build
run: |
go build -v -trimpath -buildvcs=false ./services/horizon
touch empty
- name: Save Horizon binary and integration tests source hash to cache
id: horizon_binary_tests_hash
uses: actions/cache@v3
with:
path: ./empty
key: horizon-hash-${{ hashFiles('./horizon') }}-${{ hashFiles('./clients/horizonclient/**') }}-${{ hashFiles('./protocols/horizon/**') }}-${{ hashFiles('./txnbuild/**') }}-${{ hashFiles('./services/horizon/internal/integration/**') }}-${{ env.PROTOCOL_19_CORE_DOCKER_IMG }}-${{ env.PROTOCOL_18_CORE_DOCKER_IMG }}

- if: ${{ steps.horizon_binary_tests_hash.outputs.cache-hit != 'true' }}
run: go test -race -timeout 35m -v ./services/horizon/internal/integration/...
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}
# We need to full history for git-restore-mtime to know what modification dates to use.
# Otherwise, the Go test cache will fail (due to the modification time of fixtures changing).
fetch-depth: "0"

# In order to debug the integration tests, run 'touch continue' once you connect to the ssh session
#
# - name: Setup upterm session
# uses: lhotari/action-upterm@d23c2722bdab893785c9fbeae314cbf080645bd7
# with:
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow
# limit-access-to-actor: true
# ## limits ssh access and adds the ssh public keys of the listed GitHub users
# limit-access-to-users: <yourGithubUser>

- uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.go }}

- name: Pull and set Stellar Core image
shell: bash
run: |
docker pull "$PROTOCOL_${{ matrix.protocol-version }}_CORE_DOCKER_IMG"
echo HORIZON_INTEGRATION_TESTS_DOCKER_IMG="$PROTOCOL_${{ matrix.protocol-version }}_CORE_DOCKER_IMG" >> $GITHUB_ENV
- if: ${{ matrix.protocol-version == '20' }}
name: Pull and set Soroban RPC image
shell: bash
run: |
docker pull "$PROTOCOL_${{ matrix.protocol-version }}_SOROBAN_RPC_DOCKER_IMG"
echo HORIZON_INTEGRATION_TESTS_SOROBAN_RPC_DOCKER_IMG="$PROTOCOL_${{ matrix.protocol-version }}_SOROBAN_RPC_DOCKER_IMG" >> $GITHUB_ENV
echo HORIZON_INTEGRATION_TESTS_ENABLE_SOROBAN_RPC=true >> $GITHUB_ENV
- if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }}
name: Install and enable Captive Core
run: |
# Workaround for https://github.com/actions/virtual-environments/issues/5245,
# libc++1-8 won't be installed if another version is installed (but apt won't give you a helpul
# message about why the installation fails)
sudo apt list --installed | grep libc++
sudo apt-get remove -y libc++1-* libc++abi1-* || true
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="$PROTOCOL_${{ matrix.protocol-version }}_CORE_DEBIAN_PKG_VERSION"
echo "Using stellar core version $(stellar-core version)"
echo 'HORIZON_INTEGRATION_TESTS_ENABLE_CAPTIVE_CORE=true' >> $GITHUB_ENV
echo 'HORIZON_INTEGRATION_TESTS_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_TESTS_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV

- name: Build Horizon reproducible build
run: |
go build -v -trimpath -buildvcs=false ./services/horizon
touch empty
- name: Calculate the source hash
id: calculate_source_hash
run: |
combined_hash=$(echo "horizon-hash-${{ hashFiles('./horizon') }}-${{ hashFiles('./clients/horizonclient/**') }}-${{ hashFiles('./protocols/horizon/**') }}-${{ hashFiles('./txnbuild/**') }}-${{ hashFiles('./ingest/**') }}-${{ hashFiles('./xdr/**') }}-${{ hashFiles('./services/**') }}-${{ env.PROTOCOL_20_CORE_DOCKER_IMG }}-${{ env.PROTOCOL_19_CORE_DOCKER_IMG }}-${{ env.PREFIX }}" | sha256sum | cut -d ' ' -f 1)
echo "COMBINED_SOURCE_HASH=$combined_hash" >> "$GITHUB_ENV"
- name: Restore Horizon binary and integration tests source hash to cache
id: horizon_binary_tests_hash
uses: actions/cache/restore@v3
with:
path: ./empty
lookup-only: true
key: ${{ env.COMBINED_SOURCE_HASH }}

- if: ${{ steps.horizon_binary_tests_hash.outputs.cache-hit != 'true' }}
run: go test -race -timeout 45m -v ./services/horizon/internal/integration/...

- name: Save Horizon binary and integration tests source hash to cache
if: ${{ success() && steps.horizon_binary_tests_hash.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v3
with:
path: ./empty
key: ${{ env.COMBINED_SOURCE_HASH }}

verify-range:
name: Test (and push) verify-range image
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
STELLAR_CORE_VERSION: 19.8.0-1227.040a29c51.focal
STELLAR_CORE_VERSION: 19.14.0-1500.5664eff4e.focal
CAPTIVE_CORE_STORAGE_PATH: /tmp
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: Build and test the Verify Range Docker image
run: |
docker build -f services/horizon/docker/verify-range/Dockerfile -t stellar/horizon-verify-range services/horizon/docker/verify-range/
# Any range should do for basic testing, this range was chosen pretty early in history so that it only takes a few mins to run
docker run -e BRANCH=$(git rev-parse HEAD) -e FROM=10000063 -e TO=10000127 stellar/horizon-verify-range
# Push image
- if: github.ref == 'refs/heads/master'
name: Login to DockerHub
uses: docker/login-action@bb984efc561711aaa26e433c32c3521176eae55b
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- if: github.ref == 'refs/heads/master'
name: Push to DockerHub
run: docker push stellar/horizon-verify-range:latest
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: Build and test the Verify Range Docker image
run: |
docker build -f services/horizon/docker/verify-range/Dockerfile -t stellar/horizon-verify-range services/horizon/docker/verify-range/
# Any range should do for basic testing, this range was chosen pretty early in history so that it only takes a few mins to run
docker run -e BRANCH=$(git rev-parse HEAD) -e FROM=10000063 -e TO=10000127 stellar/horizon-verify-range
# Push image
- if: github.ref == 'refs/heads/master'
name: Login to DockerHub
uses: docker/login-action@bb984efc561711aaa26e433c32c3521176eae55b
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- if: github.ref == 'refs/heads/master'
name: Push to DockerHub
run: docker push stellar/horizon-verify-range:latest
25 changes: 25 additions & 0 deletions .github/workflows/update-completed-sprint-on-issue-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Update CompletedSprint on Issue Closed

on:
issues:
types: [closed]
pull_request:
types: [closed]

jobs:
update-completed-sprint:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.GH_PROJECT_MANAGEMENT_APP_ID }}
private_key: ${{ secrets.GH_PROJECT_MANAGEMENT_APP_PEM }}
- name: Update CompletedSprint on Issue Closed
id: update_completedsprint_on_issue_closed
uses: stellar/actions/update-completed-sprint-on-issue-closed@main
with:
project_name: "Platform Scrum"
field_name: "CompletedSprint"
project_token: ${{ steps.generate_token.outputs.token }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/vendor
/dist
/local-archive
/services/horizon/captive-core
/services/horizon/horizon
/services/horizon/stellar-horizon
.vscode
.idea
debug
Expand All @@ -12,3 +15,8 @@ debug
*.key
*.prof
*.test
*.index
*.xdr
*.db
*.conf
*.lock
Loading

0 comments on commit 55b2b37

Please sign in to comment.