Skip to content

Setup CI workflows for each subproject with PR and main branch triggers #10

Setup CI workflows for each subproject with PR and main branch triggers

Setup CI workflows for each subproject with PR and main branch triggers #10

name: soroban-indexer CI
on:
push:
branches: [main]
paths:
- 'soroban/indexer/**'
- '.github/workflows/soroban-indexer-ci.yml'
pull_request:
branches: [main]
paths:
- 'soroban/indexer/**'
- '.github/workflows/soroban-indexer-ci.yml'
jobs:
build-and-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./soroban/indexer
strategy:
matrix:
go-version: ['1.23']
steps:
- uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: soroban/indexer/go.sum
- name: Download dependencies
run: make deps
- name: Verify dependencies
run: make verify
- name: Format check
run: |
make fmt
if [ -n "$(git status --porcelain)" ]; then
echo "Code is not formatted. Please run 'make fmt'"
git diff
exit 1
fi
- name: Run go vet
run: make vet
continue-on-error: true
- name: Build project
run: make build
- name: Run tests
run: make test-coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./soroban/indexer/coverage.out
flags: soroban-indexer
name: soroban-indexer-coverage