Skip to content

CI: use conda to install bmad in GitHub Actions #689

CI: use conda to install bmad in GitHub Actions

CI: use conda to install bmad in GitHub Actions #689

Workflow file for this run

name: Tests
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *" # every day at midnight
jobs:
build:
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
depth: 1
- uses: actions/checkout@v4
with:
repository: bmad-sim/bmad-ecosystem
depth: 1
path: /home/runner/work/pytao/pytao/bmad
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge
activate-environment: pytao-dev
environment-file: dev-environment.yml
- name: Setup Bmad
run: |
PYTAO_ROOT=/home/runner/work/pytao/pytao
echo "ACC_ROOT_DIR=$PYTAO_ROOT/bmad" >> $GITHUB_ENV
# echo "TAO_DIR=/home/runner/bmad/bmad_dist/tao" >> $GITHUB_ENV
# echo "ACC_EXE=/home/runner/bmad/bmad_dist/production/bin" >> $GITHUB_ENV
- name: Show conda environment packages
shell: bash -l {0}
run: |
conda list
- name: Ensure importability
shell: bash -l {0}
run: |
cd /
python -c "import pytao"
- name: Run Tests
shell: bash -l {0}
run: |
echo -e '## Test results\n\n```' >> "$GITHUB_STEP_SUMMARY"
pytest -v --cov=pytao/ pytao/tests 2>&1 | tee -a "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"