Repository navigation
Setup CI workflows for each subproject with PR and main branch triggers #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |