Skip to content

Commit

Permalink
Merge branch 'events-db-backend' into refactor-get-events
Browse files Browse the repository at this point in the history
  • Loading branch information
psheth9 committed Jun 20, 2024
2 parents e86cebc + 6142b90 commit 4d809d2
Show file tree
Hide file tree
Showing 119 changed files with 4,039 additions and 6,512 deletions.
90 changes: 45 additions & 45 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
name: 'Setup the Go environment'
description: 'Installs go and restores/saves the build/module cache'
inputs:
go-version:
required: true
runs:
using: "composite"
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ inputs.go-version }}
stable: ${{ !(contains(inputs.go-version, 'beta') || contains(inputs.go-version, 'rc')) }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
# unfortunately we cannot use the provided caching because it uses the
# same cache for all workflows/jobs, leading to undesired cache clashes,
# causing uncached test runs etc ...
# You can see the cache key at https://github.com/actions/setup-go/blob/4e0b6c77c6448caafaff5eed51516cad78e7639a/src/cache-restore.ts#L34
# There is a ticket to add prefixes for the cache, which should solve it https://github.com/actions/setup-go/issues/358
cache: false

# Restore original modification time of files based on the date of the most
# recent commit that modified them as mtimes affect the Go test cache.
- name: Restore modification time of checkout files
shell: bash
run: |
# Set a base, fixed modification time of all directories.
# git-restore-mtime doesn't set the mtime of all directories.
# (see https://github.com/MestreLion/git-tools/issues/47 for details)
touch -m -t '201509301646' $(find . -type d -not -path '.git/*')
# Restore original modification time from git. git clone sets the
# modification time to the current time, but Go tests that access fixtures
# get invalidated if their modification times change.
sudo apt-get install -y git-restore-mtime
git restore-mtime
# Restore original modification time of files based on the date of the most
# recent commit that modified them as mtimes affect the Go test cache.
# See https://github.com/golang/go/issues/58571 for details
- name: Restore modification time of checkout files
uses: chetan/git-restore-mtime-action@075f9bc9d159805603419d50f794bd9f33252ebe

# The PREFIX must uniquely identify the specific instance of a job executing.
- shell: bash
run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ inputs.go-version }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV

# Cache the Go Modules downloaded during the job.
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ env.PREFIX }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ env.PREFIX }}-go-mod-
# KEY_PREFIX must uniquely identify the specific instance of a job executing.
- shell: bash
run: |
echo 'KEY_PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ inputs.go-version }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_OUTPUT
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
if [ ${{ runner.os }} != 'Windows' ]; then echo SUDO='sudo' >> $GITHUB_OUTPUT; fi
id: variables

# Cache any build and test artifacts during the job, which will speed up
# rebuilds and cause test runs to skip tests that have no reason to rerun.
- uses: actions/cache@v2
with:
path: ~/.cache/go-build
key: ${{ env.PREFIX }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }}
restore-keys: |
${{ env.PREFIX }}-go-build-${{ github.ref }}-
${{ env.PREFIX }}-go-build-
# Cache the Go Modules downloaded during the job.
- uses: actions/cache@v4
with:
path: ${{ steps.variables.outputs.GOMODCACHE }}
key: ${{ steps.variables.outputs.KEY_PREFIX }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ steps.variables.outputs.KEY_PREFIX }}-go-mod-

# Cache any build and test artifacts during the job, which will speed up
# rebuilds and cause test runs to skip tests that have no reason to rerun.
- uses: actions/cache@v4
with:
path: ${{ steps.variables.outputs.GOCACHE }}
key: ${{ steps.variables.outputs.KEY_PREFIX }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }}
restore-keys: |
${{ steps.variables.outputs.KEY_PREFIX }}-go-build-${{ github.ref }}-
${{ steps.variables.outputs.KEY_PREFIX }}-go-build-
# Reset the cache for master/protected branches, to ensure they build and run the tests from zero
# and that the module cache is cleaned (otherwise it accumulates orphan dependencies over time).
- if: github.ref_protected
shell: bash
run: ${{ steps.variables.outputs.SUDO }} rm -rf ${{ steps.variables.outputs.GOMODCACHE }} ${{ steps.variables.outputs.GOCACHE }}

# Reset the cache for master/protected branches, to ensure they build and run the tests from zero
# and that the module cache is cleaned (otherwise it accumulates orphan dependencies over time).
- if: github.ref_protected
shell: bash
run: sudo rm -rf ~/.cache/go-build ~/go/pkg/mod
15 changes: 0 additions & 15 deletions .github/workflows/bump-version.yml

This file was deleted.

36 changes: 21 additions & 15 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,27 @@ jobs:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
- language: go
build-mode: autobuild

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
with:
go-version: 1.22
- run: rustup update
- uses: stellar/actions/rust-cache@main
- run: make build-libpreflight

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
12 changes: 6 additions & 6 deletions .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Dependency sanity checker

on:
push:
branches: [main, release/**]
branches: [ main, release/** ]
pull_request:

defaults:
Expand All @@ -13,14 +13,14 @@ jobs:
dependency-sanity-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: rustup update
- uses: actions/setup-go@v3
with:
go-version: 1.22
- uses: stellar/actions/rust-cache@main
- uses: ./.github/actions/setup-go
- run: scripts/check-dependencies.bash

validate-rust-git-rev-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: stellar/actions/rust-check-git-rev-deps@main
22 changes: 12 additions & 10 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: Soroban Tools e2e

on:
push:
branches: [main, release/**]
branches: [ main, release/** ]
pull_request:

jobs:
integration:
name: System tests
strategy:
matrix:
scenario-filter: ["^TestDappDevelop$/^.*$"]
scenario-filter: [ "^TestDappDevelop$/^.*$" ]
runs-on: ubuntu-latest-4-cores
env:
# the gh tag of system-test repo version to run
Expand All @@ -23,11 +23,12 @@ jobs:

# core git ref should be latest commit for stable soroban functionality
# the core bin can either be compiled in-line here as part of ci,
SYSTEM_TEST_CORE_GIT_REF: https://github.com/stellar/stellar-core.git#v20.1.0
SYSTEM_TEST_CORE_GIT_REF:
SYSTEM_TEST_CORE_COMPILE_CONFIGURE_FLAGS: "--disable-tests"
# or set SYSTEM_TEST_CORE_GIT_REF to empty, and set SYSTEM_TEST_CORE_IMAGE
# to pull a pre-compiled image from dockerhub instead
SYSTEM_TEST_CORE_IMAGE:
SYSTEM_TEST_CORE_IMAGE: stellar/stellar-core:20
SYSTEM_TEST_CORE_IMAGE_BIN_PATH: /usr/bin/stellar-core

# sets the version of rust toolchain that will be pre-installed in the
# test runtime environment, tests invoke rustc/cargo
Expand All @@ -41,8 +42,8 @@ jobs:
# option #2, set the version of stellar-sdk used as a ref to a gh repo if
# a value is set on SYSTEM_TEST_JS_STELLAR_SDK_GH_REPO, it takes
# precedence over any SYSTEM_TEST_JS_STELLAR_SDK_NPM_VERSION
SYSTEM_TEST_JS_STELLAR_SDK_GH_REPO:
SYSTEM_TEST_JS_STELLAR_SDK_GH_REF:
SYSTEM_TEST_JS_STELLAR_SDK_GH_REPO:
SYSTEM_TEST_JS_STELLAR_SDK_GH_REF:

# the version of rs-stellar-xdr to use for quickstart
SYSTEM_TEST_RS_XDR_GIT_REF: v20.0.2
Expand All @@ -58,18 +59,18 @@ jobs:
SYSTEM_TEST_SOROBAN_EXAMPLES_GIT_HASH: "v20.0.0"
SYSTEM_TEST_SOROBAN_EXAMPLES_GIT_REPO: "https://github.com/stellar/soroban-examples.git"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: checkout system-test
with:
repository: stellar/system-test
ref: ${{ env.SYSTEM_TEST_GIT_REF }}
path: system-test
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: checkout soroban-tools
with:
repository: stellar/soroban-tools
path: soroban-tools
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: checkout soroban-rpc
with:
repository: stellar/soroban-rpc
Expand All @@ -80,7 +81,7 @@ jobs:
run: |
rm -rf $GITHUB_WORKSPACE/system-test/js-stellar-sdk;
- if: ${{ env.SYSTEM_TEST_JS_STELLAR_SDK_GH_REPO != ''}}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ env.SYSTEM_TEST_JS_STELLAR_SDK_GH_REPO }}
ref: ${{ env.SYSTEM_TEST_JS_STELLAR_SDK_GH_REF }}
Expand All @@ -98,6 +99,7 @@ jobs:
CORE_GIT_REF=$SYSTEM_TEST_CORE_GIT_REF \
CORE_COMPILE_CONFIGURE_FLAGS="$SYSTEM_TEST_CORE_COMPILE_CONFIGURE_FLAGS" \
CORE_IMAGE=$SYSTEM_TEST_CORE_IMAGE \
CORE_IMAGE_BIN_PATH=$SYSTEM_TEST_CORE_IMAGE_BIN_PATH \
SOROBAN_RPC_GIT_REF=$SYSTEM_TEST_SOROBAN_RPC_REF \
SOROBAN_CLI_GIT_REF=$SYSTEM_TEST_SOROBAN_CLI_REF \
RUST_TOOLCHAIN_VERSION=$SYSTEM_TEST_RUST_TOOLCHAIN_VERSION \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
name: Linters
name: Go
on:
push:
branches:
- main
branches: [ main, release/** ]
pull_request:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: allow the action to annotate code in the PR.
checks: write

jobs:
golangci:
golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # version v3.0.2
uses: actions/checkout@v4
with:
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
- name: Setup GO
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # version v3.3.0
with:
go-version: '>=1.22.1'

- uses: ./.github/actions/setup-go

- uses: stellar/actions/rust-cache@main
- name: Build libpreflight
run: |
rustup update
make build-libpreflight
- name: Run golangci-lint
uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # version v3.2.0
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # version v6.0.1
with:
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
version: v1.59.1 # this is the golangci-lint version
github-token: ${{ secrets.GITHUB_TOKEN }}
only-new-issues: true

Expand Down
74 changes: 0 additions & 74 deletions .github/workflows/publish.yml

This file was deleted.

Loading

0 comments on commit 4d809d2

Please sign in to comment.