Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to macOS M1 runner #328

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 12 additions & 32 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ jobs:
strategy:
matrix:
os: [
"macos-latest",
"macos-latest-xlarge",
"ubuntu-20.04"
]

runs-on: ${{ matrix.os }}
# TODO: (#310) Remove when migrating to macOS arm64 runner
env:
V2_COMPILER_BUILD_PATH: ${{ github.workspace }}/cairo2/target/release
DEVNET_SHA: 8c4b73361cb1e15412c68f18ef18da08586a8461
steps:
- uses: actions/checkout@v3
Expand All @@ -30,16 +28,24 @@ jobs:
distribution: temurin
java-version: 11

- name: Setup NDK
if : matrix.os == 'macos-latest-xlarge'
uses: nttld/setup-ndk@72e37d9f270c8e0bbeb67f4f51d3435b614d6a52
with:
ndk-version: r32
local-cache: true
add-to-path: true

- name: Setup cmake
uses: jwlawson/actions-setup-cmake@4f73d30c2fc44a9466a3ed890fb8db7a7b554302
with:
cmake-version: '3.16.x'

- name: Setup Python
uses: actions/setup-python@v4.5.0
uses: gabrielfalcao/pyenv-action@be40e3b6857d82977fd05e697ba3b7824a101c70
with:
python-version: 3.9.12
cache: 'pip'
default: 3.9.12
command: pip install --upgrade pip

- name: Install legacy devnet
run: |
Expand Down Expand Up @@ -88,32 +94,6 @@ jobs:
- name: Lint
run: ./gradlew :lib:lintKotlin

# TODO: (#310) Remove when migrating to macOS arm64 runner
- name: Clone Cairo repo (macOS only)
if: matrix.os == 'macos-latest'
run: git clone -b v2.2.0 https://github.com/starkware-libs/cairo.git cairo2

- name: Cache Cairo compiler v2 binaries (macOS only)
if: matrix.os == 'macos-latest'
uses: actions/cache@v3
with:
path: cairo2/target/release
key: ${{ runner.os }}-cairo2-target-release-${{ hashFiles('cairo2/Cargo.lock') }}

- name: Build Cairo compiler binaries (macOS only)
if: matrix.os == 'macos-latest'
run: |
if [[ ! -d "$V2_COMPILER_BUILD_PATH" ]]; then
curl -sSf https://sh.rustup.rs | sh -s -- -y
pushd ${{ github.workspace }}/cairo2
cargo build --release
cargo run --bin starknet-compile -- --version
cargo run --bin starknet-sierra-compile -- --version
popd
else
echo "Found existing binaries, skipping compilation."
fi

- name: Run tests and generate coverage report
env:
DEVNET_PATH: ${{ github.workspace }}/starknet-devnet-rs/target/release/starknet-devnet
Expand Down