-
Notifications
You must be signed in to change notification settings - Fork 75
129 lines (119 loc) · 4.37 KB
/
soroban-rpc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Soroban RPC
defaults:
run:
shell: bash
on:
push:
branches: [main, release/**]
pull_request:
jobs:
test:
name: Unit tests
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
go: [1.21]
runs-on: ${{ matrix.os }}
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"
- uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.go }}
- name: Build soroban contract fixtures
run: |
rustup update
rustup target add wasm32-unknown-unknown
make build-test-wasms
- run: make build-libpreflight
- run: go test -race -cover -timeout 25m -v ./cmd/soroban-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@v3
# we cannot use our own ./.github/actions/setup-go action
# because it uses apt-get and some OSs (e.g. windows) don't have it
- uses: actions/setup-go@v3
with:
go-version: 1.21
- run: |
rustup target add ${{ matrix.rust_target }}
rustup update
# On windows, make sure we have the same compiler (linker) used by rust.
# This is important since the symbols names won't match otherwise.
- if: matrix.os == 'windows-latest'
name: Install the same mingw gcc compiler used by rust
run: |
C:/msys64/usr/bin/pacman.exe -S mingw-w64-x86_64-gcc --noconfirm
echo "CC=C:/msys64/mingw64/bin/gcc.exe" >> $GITHUB_ENV
echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH
# 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
- name: Build libpreflight
run: make build-libpreflight
env:
CARGO_BUILD_TARGET: ${{ matrix.rust_target }}
- name: Build Soroban RPC reproducible build
run: |
go build -trimpath -buildvcs=false ./cmd/soroban-rpc
ls -lh soroban-rpc
file soroban-rpc
env:
CGO_ENABLED: 1
GOARCH: ${{ matrix.go_arch }}
integration:
name: Integration tests
continue-on-error: true
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
go: [1.21]
test: ['.*CLI.*', '^Test(([^C])|(C[^L])|(CL[^I])).*$']
runs-on: ${{ matrix.os }}
env:
SOROBAN_RPC_INTEGRATION_TESTS_ENABLED: true
SOROBAN_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core
PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 20.2.0-1716.rc3.34d82fc00.focal
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"
- uses: ./.github/actions/setup-integration-tests
with:
go-version: ${{ matrix.go }}
- name: Run Soroban RPC Integration Tests
run: |
go test -race -run '${{ matrix.test }}' -timeout 60m -v ./cmd/soroban-rpc/internal/test/...