Spaces:
Sleeping
Sleeping
name: CI_conda | |
# This tests whether conda, a statically-linked libpython, works | |
# with PySR. | |
on: | |
push: | |
branches: | |
- '*' | |
paths: | |
- 'test/**' | |
- 'pysr/**' | |
- '.github/workflows/**' | |
- 'setup.py' | |
- 'Project.toml' | |
pull_request: | |
branches: | |
- '*' | |
paths: | |
- 'test/**' | |
- 'pysr/**' | |
- '.github/workflows/**' | |
- 'setup.py' | |
- 'Project.toml' | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
julia-version: ['1.7.1'] | |
python-version: ['3.9'] | |
os: ['ubuntu-latest'] | |
steps: | |
- uses: actions/[email protected] | |
- name: "Set up Julia" | |
uses: julia-actions/[email protected] | |
with: | |
version: ${{ matrix.julia-version }} | |
- name: "Change package server" | |
shell: bash | |
env: | |
JULIA_PKG_SERVER: "" | |
run: | | |
julia -e 'using Pkg; Pkg.Registry.add("General")' | |
- 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 Conda" | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
auto-activate-base: true | |
python-version: ${{ matrix.python-version }} | |
activate-environment: test | |
environment-file: environment.yml | |
- name: "Install PySR" | |
run: | | |
python3 -m pip install . | |
python3 -c 'import pysr; pysr.install()' | |
shell: bash -l {0} | |
- name: "Ensure that static libpython warning appears" | |
run: python3 test/test_static_libpython_warning.py | |
shell: bash -l {0} | |
- name: "Run tests" | |
run: python3 -m unittest test.test | |
shell: bash -l {0} |