This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
update cairo-native and starknet 2.5.4 #5466
Workflow file for this run
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: rust-tests | |
on: | |
merge_group: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ '*' ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_TOOLCHAIN: '1.74.1' | |
jobs: | |
build: | |
name: Build with release profile | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Rust $RUST_TOOLCHAIN | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: $RUST_TOOLCHAIN | |
components: rustfmt, clippy | |
- name: Python3 Build | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Install deps | |
run: make deps | |
- name: Build | |
run: make build | |
lint: | |
name: Lint with fmt and clippy | |
runs-on: ubuntu-latest | |
env: | |
MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/ | |
TABLEGEN_170_PREFIX: /usr/lib/llvm-17/ | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Rust $RUST_TOOLCHAIN | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: $RUST_TOOLCHAIN | |
components: rustfmt, clippy | |
- name: Python3 Build | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: check and free hdd space left | |
run: | | |
echo "Listing 20 largest packages" | |
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 20 | |
df -h | |
sudo apt-get update | |
sudo apt-get remove -y '^llvm-.*' | |
sudo apt-get remove -y 'php.*' | |
sudo apt-get remove -y '^dotnet-.*' | |
sudo apt-get remove -y '^temurin-.*' | |
sudo apt-get remove -y azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox powershell mono-devel | |
sudo apt-get autoremove -y | |
sudo apt-get clean | |
df -h | |
echo "Removing large directories" | |
# deleting 15GB | |
sudo rm -rf /usr/share/dotnet/ | |
sudo rm -rf /usr/local/lib/android | |
df -h | |
- name: add llvm deb repository | |
uses: myci-actions/add-deb-repo@10 | |
with: | |
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main | |
repo-name: llvm-repo | |
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key | |
- name: Install LLVM | |
run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools | |
- name: Install deps | |
run: make deps | |
- name: Format | |
run: cargo fmt --all -- --check | |
- name: Run clippy | |
run: make clippy | |
tests: | |
env: | |
RPC_ENDPOINT_TESTNET: ${{ secrets.JUNO_ENDPOINT_TESTNET }} | |
RPC_ENDPOINT_MAINNET: ${{ secrets.JUNO_ENDPOINT_MAINNET }} | |
MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/ | |
TABLEGEN_170_PREFIX: /usr/lib/llvm-17/ | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [ test-cairo-1, test-cairo-2, test-doctests, test-cairo-native ] | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Rust $RUST_TOOLCHAIN | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: $RUST_TOOLCHAIN | |
components: rustfmt, clippy | |
- name: Python3 Build | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Install deps | |
run: make deps | |
- name: Install testing tools | |
# TODO: remove `if` when nextest adds doctests support | |
if: ${{ matrix.target != 'test-doctests' }} | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: [email protected] | |
- name: check and free hdd space left | |
run: | | |
echo "Listing 20 largest packages" | |
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 20 | |
df -h | |
sudo apt-get update | |
sudo apt-get remove -y '^llvm-.*' | |
sudo apt-get remove -y 'php.*' | |
sudo apt-get remove -y '^dotnet-.*' | |
sudo apt-get remove -y '^temurin-.*' | |
sudo apt-get remove -y azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox powershell mono-devel | |
sudo apt-get autoremove -y | |
sudo apt-get clean | |
df -h | |
echo "Removing large directories" | |
# deleting 15GB | |
sudo rm -rf /usr/share/dotnet/ | |
sudo rm -rf /usr/local/lib/android | |
df -h | |
- name: add llvm deb repository | |
uses: myci-actions/add-deb-repo@10 | |
with: | |
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main | |
repo-name: llvm-repo | |
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key | |
- name: Install LLVM | |
run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools | |
- name: Run tests (${{ matrix.target }}) | |
run: make ${{ matrix.target }} | |
coverage: | |
name: Generate and upload coverage report | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/[email protected] | |
with: | |
components: llvm-tools-preview | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Cache coverage report | |
id: restore-report | |
uses: actions/cache/restore@v3 | |
with: | |
path: lcov.info | |
key: coverage-cache-${{ github.sha }} | |
- name: Python3 Build | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Install deps | |
run: make deps | |
- name: Generate coverage report | |
if: steps.restore-report.outputs.cache-hit != 'true' | |
run: make coverage-report | |
- name: Save coverage report | |
if: steps.restore-report.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v3 | |
with: | |
path: lcov.info | |
key: coverage-cache-${{ github.sha }} | |
- name: Upload coverage to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: lcov.info |