-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
132 additions
and
29 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "conda setup" | ||
description: "Prepare the pytao conda environment" | ||
inputs: | ||
python-version: | ||
description: Python version | ||
required: false | ||
default: "3.9" | ||
environment-file: | ||
description: Conda environment file | ||
required: true | ||
default: "environment.yaml" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Mambaforge | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniforge-variant: Mambaforge | ||
activate-environment: pytao-dev | ||
use-mamba: true | ||
channels: conda-forge | ||
environment-file: ${{ inputs.environment-file }} | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Show the installed packages | ||
shell: bash -l {0} | ||
run: | | ||
conda list | ||
- name: Ensure importability | ||
shell: bash -l {0} | ||
run: | | ||
cd / | ||
python -c "import pytao" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: setup-dependencies | ||
description: "Setup system and external dependencies to build bmad" | ||
inputs: | ||
external-packages-version: | ||
description: External packages version | ||
required: false | ||
default: "main" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
# Install system dependencies | ||
- name: Install System Dependencies | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gfortran g++ cmake libtool-bin libreadline-dev libpango1.0-dev libssl-dev bc libopenmpi-dev openmpi-bin openmpi-common | ||
- name: Checkout external packages | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "bmad-sim/bmad-external-packages" | ||
ref: ${{ inputs.external-packages-version }} | ||
path: "external_packages" | ||
fetch-depth: 1 | ||
|
||
- name: Move External Packages | ||
shell: bash | ||
run: | | ||
mv external_packages ~/ | ||
for dep in ~/external_packages/*; do | ||
if [ $dep != "README.md" ]; then | ||
cp -r $dep $GITHUB_WORKSPACE/; | ||
fi; | ||
done |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: PyTao tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
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.12"] | ||
shared: ["Y"] | ||
openmp_mpi: ["N"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-dependencies | ||
with: | ||
external-packages-version: ${{ env.EXTERNAL_PACKAGES_VERSION }} | ||
|
||
- name: Build Bmad | ||
env: | ||
USE_MPI: ${{ matrix.openmp_mpi }} | ||
SHARED: ${{ matrix.shared }} | ||
run: .github/scripts/install_bmad.sh | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
repository: "bmad-sim/pytao" | ||
ref: "master" | ||
path: "pytao" | ||
|
||
- uses: ./.github/actions/conda-setup | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: pytao/dev-environment.yml | ||
|
||
- name: Run Tests | ||
shell: bash -l {0} | ||
working-directory: ./pytao | ||
run: | | ||
export ACC_ROOT_DIR=$GITHUB_WORKSPACE | ||
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" |