PySR / .github /workflows /CI_mac.yml
MilesCranmer's picture
Add custom env test to CI
acb3fea
raw
history blame
1.97 kB
name: macOS
on:
push:
branches:
- '*'
paths:
- 'test/**'
- 'pysr/**'
- '.github/workflows/CI_mac.yml'
- 'setup.py'
pull_request:
branches:
- '*'
paths:
- 'test/**'
- 'pysr/**'
- '.github/workflows/CI_mac.yml'
- 'setup.py'
jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
julia-version: ['1.7.1']
python-version: ['3.9']
os: [macos-latest]
steps:
- uses: actions/[email protected]
- name: "Set up Julia"
uses: julia-actions/[email protected]
with:
version: ${{ matrix.julia-version }}
- name: "Cache dependencies"
uses: actions/cache@v1 # Thanks FromFile.jl
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: "Set up Python"
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: "Install PySR"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
python -c 'import pysr; pysr.install()'
- name: "Run tests"
run: python -m unittest test.test
- name: "Install JAX"
run: pip install jax jaxlib # (optional import)
- name: "Run JAX tests"
run: python -m unittest test.test_jax
- name: "Install Torch"
run: pip install torch # (optional import)
- name: "Run Torch tests"
run: python -m unittest test.test_torch
- name: "Run custom env tests"
run: python -m unittest test.test_env