Support RPC 0.8.0 #1731
This file contains 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: Checks | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test_and_lint: | |
strategy: | |
matrix: | |
os: [ | |
"macos-latest", | |
"ubuntu-20.04" | |
] | |
runs-on: ${{ matrix.os }} | |
env: | |
DEVNET_SHA: 47ee2a73c227ee356f344ce94e5f61871299be80 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be | |
with: | |
cmake-version: '3.18.1' | |
# TODO: Replace with installing release when release is available | |
- name: Clone starknet-devnet-rs | |
run: | | |
git clone https://github.com/0xSpaceShard/starknet-devnet-rs.git starknet-devnet-rs | |
pushd ${{ github.workspace }}/starknet-devnet-rs | |
git checkout ${{ env.DEVNET_SHA }} | |
popd | |
- name: Cache devnet build | |
uses: actions/cache@v4 | |
with: | |
path: starknet-devnet-rs/target/release | |
key: ${{ runner.os }}-starknet-devnet-rs-target-release-${{ env.DEVNET_SHA }} | |
- name: Build devnet | |
run: | | |
if [[ ! -d ${{ github.workspace }}/starknet-devnet-rs/target/release ]]; then | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
pushd ${{ github.workspace }}/starknet-devnet-rs | |
cargo build --release | |
popd | |
else | |
echo "Found existing starknet-devnet-rs build, skipping compilation." | |
fi | |
- name: Setup asdf | |
uses: asdf-vm/actions/setup@v2 | |
- name: Install sncast 0.24.0 | |
run: | | |
asdf plugin add starknet-foundry | |
asdf install starknet-foundry 0.24.0 | |
asdf global starknet-foundry 0.24.0 | |
- name: Install scarb | |
run: | | |
asdf plugin add scarb | |
asdf install scarb 0.4.0 | |
asdf install scarb 0.7.0 | |
asdf install scarb 2.6.0 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
cache-read-only: false | |
- name: Lint | |
run: ./gradlew :lib:lintKotlin | |
- name: Check guides | |
run: | | |
./gradlew :lib:generateGuides | |
if ! git diff --exit-code lib/*.md; then | |
echo "Error: Guides are not up-to-date. Please run './gradlew :lib:generateGuides' and commit the changes." | |
exit 1 | |
else | |
echo "Guides are up-to-date" | |
fi | |
- name: Run tests and generate coverage report | |
env: | |
DEVNET_PATH: ${{ github.workspace }}/starknet-devnet-rs/target/release/starknet-devnet | |
NETWORK_TEST_MODE: "disabled" | |
run: ./gradlew :lib:koverXmlReport --info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 | |
with: | |
files: lib/build/reports/kover/report.xml |