Skip to content

Update build.yaml

Update build.yaml #28

Workflow file for this run

name: Python package
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
torch-version: ["2.4.0"]
include:
- os: windows-latest
torch-version: 2.4.0
python-version: "3.12"
runs-on: ${{ matrix.os }}
steps:
- name: Clear pip cache
run: |
if ($Env:RUNNER_OS -eq "Windows") { Remove-Item -Recurse -Force $env:USERPROFILE\.cache\pip } else { rm -rf ~/.cache/pip }
- name: Cache dependencies
id: pip-cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-os_${{ runner.os }}-python_${{ matrix.python-version }}-torch_${{ matrix.torch-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install git+https://github.com/RobustBench/robustbench.git
python -m pip install --upgrade pip setuptools wheel
python -m pip install packaging==24.2
python -m pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu
pip install '.[dev]'
- name: Run pytest tests
timeout-minutes: 10
run: |
pip install pytest
python -m pytest
- name: Build package
run: |
make build
- name: Check reinstall script
timeout-minutes: 3
run: |
./reinstall.sh