Decompose integration tests out of build and test flows #1126
Workflow file for this run
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: Stellar RPC | |
| defaults: | |
| run: | |
| shell: bash | |
| on: | |
| push: | |
| branches: [ main, release/** ] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Unit tests | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-22.04 ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| 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" | |
| - uses: ./.github/actions/setup-go | |
| - run: rustup update | |
| - uses: stellar/actions/rust-cache@main | |
| - run: make build-libs | |
| - run: go test -race -timeout 25m ./cmd/stellar-rpc/... | |
| build: | |
| name: Build | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| rust_target: x86_64-unknown-linux-gnu | |
| go_arch: amd64 | |
| - os: ubuntu-latest | |
| rust_target: aarch64-unknown-linux-gnu | |
| go_arch: arm64 | |
| - os: macos-latest | |
| rust_target: x86_64-apple-darwin | |
| go_arch: amd64 | |
| - os: macos-latest | |
| rust_target: aarch64-apple-darwin | |
| go_arch: arm64 | |
| - os: windows-latest | |
| rust_target: x86_64-pc-windows-gnu | |
| go_arch: amd64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-go | |
| # Use cross-compiler for linux aarch64 | |
| - if: matrix.rust_target == 'aarch64-unknown-linux-gnu' | |
| name: Install aarch64 cross-compilation toolchain | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-10-aarch64-linux-gnu | |
| echo 'CC=aarch64-linux-gnu-gcc-10' >> $GITHUB_ENV | |
| - run: | | |
| rustup target add ${{ matrix.rust_target }} | |
| rustup update | |
| - uses: stellar/actions/rust-cache@main | |
| - run: make build-libs | |
| env: | |
| CARGO_BUILD_TARGET: ${{ matrix.rust_target }} | |
| - name: Build Stellar RPC reproducible build | |
| run: | | |
| go build -trimpath -buildvcs=false ./cmd/stellar-rpc | |
| ls -lh stellar-rpc | |
| file stellar-rpc | |
| env: | |
| CGO_ENABLED: 1 | |
| GOARCH: ${{ matrix.go_arch }} | |
| integration-p25-pkg: | |
| name: Integration tests (p25, packaged core) | |
| uses: ./.github/workflows/integration-tests.yml | |
| with: | |
| protocol_version: '25' | |
| core_version: '25.2.0-3045.rc2.bb195c49d.jammy' | |
| integration-p25-src: | |
| name: Integration tests (p25, core from source) | |
| uses: ./.github/workflows/integration-tests.yml | |
| with: | |
| protocol_version: '25' | |
| core_git_ref: 'master' | |
| # To test previous protocol, add entries here, e.g.: | |
| # integration-p24-pkg: | |
| # name: Integration tests (p24, packaged core) | |
| # uses: ./.github/workflows/integration-tests.yml | |
| # with: | |
| # protocol_version: '24' | |
| # core_version: '19.14.0-1526.ef4f31a28.jammy' |