Skip to content

.

. #14

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Test Plugin Structure
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install fz framework
run: |
pip install git+https://github.com/Funz/fz.git
- name: Validate JSON files
run: |
echo "Validating model files..."
for f in .fz/models/*.json; do
echo " Checking $f"
python -m json.tool "$f" > /dev/null
done
echo "Validating calculator config files..."
for f in .fz/calculators/*.json; do
echo " Checking $f"
python -m json.tool "$f" > /dev/null
done
- name: Check shell script syntax
run: |
echo "Checking shell scripts..."
for f in .fz/calculators/*.sh; do
echo " Checking $f"
bash -n "$f"
done
- name: Run plugin tests
run: |
python tests/test_plugin.py
- name: Test fzi (parse variables)
run: |
python -c "
import fz
variables = fz.fzi('examples/Scale-keno/godiva.inp', 'Scale-keno')
print(f'Variables found: {list(variables.keys())}')
assert 'r' in variables, 'Variable r not found'
print('✓ fzi test passed')
"
- name: Test fzc (compile input)
run: |
python -c "
import fz
import tempfile
import os
with tempfile.TemporaryDirectory() as tmpdir:
fz.fzc('examples/Scale-keno/godiva.inp', {'r': 8.741}, 'Scale-keno', output_dir=tmpdir)
compiled = os.path.join(tmpdir, 'r=8.741', 'godiva.inp')
assert os.path.exists(compiled), 'Compiled file not created'
with open(compiled) as f:
content = f.read()
assert '8.741' in content, 'Variable not substituted'
assert '&(r)' not in content, 'Variable marker still present'
print('✓ fzc test passed')
"
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check shell scripts are executable
run: |
for f in .fz/calculators/*.sh; do
if [ ! -x "$f" ]; then
echo "Error: $f is not executable"
exit 1
fi
done
docs:
name: Check Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check required documentation files
run: |
for f in README.md LICENSE CONTRIBUTING.md MIGRATION.md; do
if [ ! -f "$f" ]; then
echo "Error: Missing $f"
exit 1
fi
echo "✓ $f exists"
done
- name: Check example files
run: |
if [ ! -f "examples/Scale-keno/godiva.inp" ]; then
echo "Error: Missing example input file"
exit 1
fi
echo "✓ Example files present"