Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated GitHub Workflows #1111

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/dymos_docs_workflow.yml
Original file line number Diff line number Diff line change
@@ -72,22 +72,24 @@ jobs:
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Fetch tags
run: |
git fetch --prune --unshallow --tags
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.PY }}
conda-version: "*"
channels: conda-forge

- name: Install Numpy/Scipy
shell: bash -l {0}
run: |
echo "Make sure we are not using anaconda packages"
conda config --remove channels defaults
echo "============================================================="
echo "Install Numpy/Scipy"
echo "============================================================="
126 changes: 94 additions & 32 deletions .github/workflows/dymos_tests_workflow.yml
Original file line number Diff line number Diff line change
@@ -12,9 +12,56 @@ on:
pull_request:
branches: [ master, develop ]

# Trigger via workflow_dispatch event
# Allow running the workflow manually from the Actions tab
# All jobs are excluded by default, desired jobs must be selected
workflow_dispatch:

inputs:

run_name:
type: string
description: 'Name of workflow run as it will appear under Actions tab:'
required: false
default: ""

baseline:
type: boolean
description: "Include 'baseline' in test matrix"
required: false
default: false

no_pyoptsparse:
type: boolean
description: "Include 'no_pyoptsparse' in test matrix"
required: false
default: false

no_snopt:
type: boolean
description: "Include 'no_snopt' in test matrix"
required: false
default: false

no_mpi:
type: boolean
description: "Include 'no_mpi' Baseline in test matrix"
required: false
default: false

latest:
type: boolean
description: "Include 'latest' in test matrix"
required: false
default: false

oldest:
type: boolean
description: "Include 'oldest' in test matrix"
required: false
default: false

run-name: ${{ inputs.run_name }}

jobs:

test_ubuntu:
@@ -38,6 +85,7 @@ jobs:
PEP517: true
OPTIONAL: '[all]'
JAX: '0.4.28'
EXCLUDE: ${{ github.event_name == 'workflow_dispatch' && ! inputs.baseline }}

# baseline versions except no pyoptsparse or SNOPT
- NAME: no_pyoptsparse
@@ -47,6 +95,7 @@ jobs:
PETSc: 3.21.0
OPENMDAO: 'latest'
OPTIONAL: '[test]'
EXCLUDE: ${{ github.event_name == 'workflow_dispatch' && ! inputs.no_pyoptsparse }}

# baseline versions except with pyoptsparse but no SNOPT
- NAME: no_snopt
@@ -57,6 +106,7 @@ jobs:
PYOPTSPARSE: 'v2.11.0'
OPENMDAO: 'latest'
OPTIONAL: '[test]'
EXCLUDE: ${{ github.event_name == 'workflow_dispatch' && ! inputs.no_snopt }}

# baseline versions except no MPI/PETSc
- NAME: no_mpi
@@ -66,6 +116,7 @@ jobs:
PYOPTSPARSE: 'v2.11.0'
OPENMDAO: 'latest'
OPTIONAL: '[test]'
EXCLUDE: ${{ github.event_name == 'workflow_dispatch' && ! inputs.no_mpi }}

# try latest versions
- NAME: latest
@@ -78,6 +129,7 @@ jobs:
OPENMDAO: 'dev'
OPTIONAL: '[test]'
JAX: 'latest'
EXCLUDE: ${{ github.event_name == 'workflow_dispatch' && ! inputs.latest }}

# oldest supported versions
- NAME: oldest
@@ -87,11 +139,12 @@ jobs:
OPENMPI: '4.0'
MPI4PY: '3.0'
PETSc: 3.13
PYOPTSPARSE: 'v2.6.1'
PYOPTSPARSE: 'v2.9.0'
SNOPT: 7.2
OPENMDAO: 3.28.0
MATPLOTLIB: 3.5
OPTIONAL: '[test]'
EXCLUDE: ${{ github.event_name == 'workflow_dispatch' && ! inputs.oldest }}

steps:
- name: Display run details
@@ -103,21 +156,16 @@ jobs:
echo "Triggered by: ${GITHUB_EVENT_NAME}"
echo "Initiated by: ${GITHUB_ACTOR}"
echo "============================================================="
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
if [[ "${{ matrix.NAME }}" == "latest" ]]; then
echo "Triggered by 'workflow_dispatch' event, will run '${{ matrix.NAME }}' build."
echo "RUN_BUILD=true" >> $GITHUB_ENV
if [[ "${{ matrix.EXCLUDE }}" == "false" ]]; then
echo "Triggered by 'workflow_dispatch', '${{ matrix.NAME }}' build was selected and will run."
else
echo "Triggered by 'workflow_dispatch' event, will not run '${{ matrix.NAME }}' build."
echo "Triggered by 'workflow_dispatch', '${{ matrix.NAME }}' build not selected and will not run."
fi
else
echo "Triggered by '${{ github.event_name }}' event, running all builds."
echo "RUN_BUILD=true" >> $GITHUB_ENV
fi
- name: Create SSH key
if: env.RUN_BUILD
if: ${{ ! matrix.EXCLUDE }}
shell: bash
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
@@ -129,28 +177,30 @@ jobs:
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- name: Checkout code
if: env.RUN_BUILD
uses: actions/checkout@v3
if: ${{ ! matrix.EXCLUDE }}
uses: actions/checkout@v4

- name: Setup conda
if: env.RUN_BUILD
uses: conda-incubator/setup-miniconda@v2
if: ${{ ! matrix.EXCLUDE }}
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.PY }}
conda-version: "*"
channels: conda-forge

- name: Install Numpy/Scipy
if: env.RUN_BUILD
if: ${{ ! matrix.EXCLUDE }}
shell: bash -l {0}
run: |
echo "Make sure we are not using anaconda packages"
conda config --remove channels defaults
echo "============================================================="
echo "Install Numpy/Scipy"
echo "============================================================="
conda install numpy=${{ matrix.NUMPY }} scipy=${{ matrix.SCIPY }} -q -y
- name: Install jax
if: env.RUN_BUILD && matrix.JAX
if: ${{ ! matrix.EXCLUDE && matrix.JAX }}
shell: bash -l {0}
run: |
echo "============================================================="
@@ -163,7 +213,7 @@ jobs:
fi
- name: Install PETSc
if: env.RUN_BUILD && matrix.PETSc
if: ${{ ! matrix.EXCLUDE && matrix.PETSc }}
shell: bash -l {0}
run: |
echo "============================================================="
@@ -190,7 +240,7 @@ jobs:
- name: Install pyOptSparse
id: build_pyoptsparse
if: env.RUN_BUILD && matrix.PYOPTSPARSE
if: ${{ ! matrix.EXCLUDE && matrix.PYOPTSPARSE }}
shell: bash -l {0}
run: |
echo "============================================================="
@@ -236,7 +286,7 @@ jobs:
fi
- name: Install OpenMDAO
if: env.RUN_BUILD && matrix.OPENMDAO
if: ${{ ! matrix.EXCLUDE && matrix.OPENMDAO }}
shell: bash -l {0}
run: |
echo "============================================================="
@@ -251,7 +301,7 @@ jobs:
fi
- name: Install Matplotlib
if: env.RUN_BUILD && matrix.MATPLOTLIB
if: ${{ ! matrix.EXCLUDE && matrix.MATPLOTLIB }}
shell: bash -l {0}
run: |
echo "============================================================="
@@ -260,7 +310,7 @@ jobs:
python -m pip install matplotlib==${{ matrix.MATPLOTLIB }}
- name: Install Dymos
if: env.RUN_BUILD
if: ${{ ! matrix.EXCLUDE }}
shell: bash -l {0}
run: |
echo "============================================================="
@@ -277,9 +327,19 @@ jobs:
python -m pip install .${{ matrix.OPTIONAL }}
fi
- name: Install optional dependencies
if: ${{ ! matrix.EXCLUDE && matrix.OPTIONAL == '[all]' }}
run: |
echo "============================================================="
echo "Install additional packages for testing/coverage"
echo "============================================================="
echo "Pre-install playwright dependencies to avoid 'Playwright Host validation warning'"
pip install playwright
playwright install --with-deps
- name: Display environment info
id: env_info
if: env.RUN_BUILD
if: ${{ ! matrix.EXCLUDE }}
shell: bash -l {0}
run: |
conda info
@@ -304,16 +364,16 @@ jobs:
pip install pipdeptree
pipdeptree
- name: 'Upload environment artifact'
if: env.RUN_BUILD
uses: actions/upload-artifact@v3
- name: Upload environment artifact
if: ${{ ! matrix.EXCLUDE }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.NAME }}_environment
path: ${{ matrix.NAME }}_environment.yml
retention-days: 5

- name: Check NumPy 2.0 Compatibility
if: env.RUN_BUILD
if: ${{ ! matrix.EXCLUDE }}
run: |
echo "============================================================="
echo "Check Dymos code for NumPy 2.0 compatibility"
@@ -323,7 +383,7 @@ jobs:
ruff check . --select NPY201
- name: Perform linting with Ruff
if: env.RUN_BUILD && matrix.NAME == 'baseline'
if: ${{ ! matrix.EXCLUDE && matrix.NAME == 'baseline' }}
run: |
echo "============================================================="
echo "Lint Dymos code per settings in pyproject.toml"
@@ -332,7 +392,7 @@ jobs:
ruff check . --config pyproject.toml
- name: Run tests
if: env.RUN_BUILD
if: ${{ ! matrix.EXCLUDE }}
env:
DYMOS_CHECK_PARTIALS: True
shell: bash -l {0}
@@ -353,7 +413,8 @@ jobs:
fi
- name: Submit coverage
if: ((github.event_name != 'workflow_dispatch') && (matrix.NAME != 'latest'))
if: github.event_name != 'workflow_dispatch'
continue-on-error: true
shell: bash -l {0}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -370,7 +431,8 @@ jobs:
coveralls:
name: Finish coveralls
if: (github.event_name != 'workflow_dispatch')
if: github.event_name != 'workflow_dispatch'
continue-on-error: true
needs: test_ubuntu
runs-on: ubuntu-latest
steps: