refactor: Unify PrimitiveSlice
and Scalaritem
(#128)
#2
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: CI-MacOS | |
on: | |
push: | |
branches: [ dev, main ] | |
pull_request: | |
branches: [ dev, main ] | |
env: | |
CI: true | |
jobs: | |
build: | |
runs-on: macos-15-xlarge | |
strategy: | |
matrix: | |
python-version: [3.12] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Make compile script executable | |
run: chmod +x ./mithril/backends/with_manualgrad/c_backend/src/compile.sh | |
- name: Compile C code | |
run: | | |
pushd ./mithril/backends/with_manualgrad/c_backend/src | |
./compile.sh | |
popd | |
- name: Install Python dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install torch==2.4.1 | |
pip install --upgrade "jax[cpu]" | |
pip install mlx | |
pip install -r requirements/dev.txt | |
- name: Run pre-commit | |
run: | | |
python3 -m pip install mypy | |
python3 -m pip install pre-commit | |
pre-commit run --all-files | |
python3 license_checker.py | |
- name: Execute testcase unit tests | |
run: pytest --cov --cov-report=xml -s tests/ | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
on_failure: | |
needs: build | |
runs-on: macos-15-xlarge | |
env: | |
GH_TOKEN: ${{ github.token }} | |
if: ${{ failure() }} | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: review_pr | |
id: review-pr | |
run: | | |
gh pr review ${{ github.event.pull_request.number }} -r -b "Tests are failed. Please review the PR." | |
exit 1 |