Skip to content

Add Julia discipline integration #163

Add Julia discipline integration

Add Julia discipline integration #163

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Unit and Integration Tests
on:
push:
branches:
- main
- develop
- support/*
- release/*
pull_request:
branches:
- main
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Julia
uses: julia-actions/setup-julia@v2
with:
version: '1.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 coverage[toml] grpcio grpcio-tools protoletariat numpy scipy openmdao
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
sudo apt install -y protobuf-compiler
- name: Install Package
run: |
pip install -e ".[julia]"
- name: Pre-warm juliacall Julia environment with Philote.jl
timeout-minutes: 5
run: |
python -c "
import sys
print('Initializing juliacall Julia environment...', flush=True)
from juliacall import Main as jl
print('✓ juliacall initialized', flush=True)
print('Installing Philote.jl into juliacall environment...', flush=True)
jl.seval('using Pkg')
jl.seval('Pkg.develop(url=\"https://github.com/MDO-Standards/Philote.jl.git\")')
print('✓ Philote.jl installed', flush=True)
print('Precompiling packages...', flush=True)
jl.seval('Pkg.precompile()')
print('✓ Packages precompiled', flush=True)
print('Testing Philote load...', flush=True)
jl.seval('using Philote')
print('✓ Philote.jl ready for tests', flush=True)
"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run Unit Tests with Coverage
timeout-minutes: 0.5
run: |
python -m coverage run --omit=philote_mdo/generated -m unittest discover -v -s tests -p 'test_*.py'
- name: Upload Test Coverage Report to Codecov
if: ${{ matrix.python-version == '3.12' }}
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true # optional (default = false)
# files: ./coverage1.xml,./coverage2.xml # optional
# flags: unittests # optional
# name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)