Skip to content

cli: fix conversion from n files into 1 #140

cli: fix conversion from n files into 1

cli: fix conversion from n files into 1 #140

Workflow file for this run

name: Test python package
on:
push:
paths:
- tests/**
- src/**
- pyproject.toml
- .github/workflows/test.yml
pull_request:
workflow_dispatch:
schedule:
- cron: "0 2 * * 1"
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest] # 'macos-latest' failing on github-ci with memory error
backend: ['torch','jax'] # 'tensorflow' is excluded since on github-ci tests get stuck for a yet unknown reason
python-version: ['3.10','3.11','3.12']
runs-on: ${{ matrix.os }}
steps:
- name: Remove unnecessary tools (Linux)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# when set to "true" but frees about 6 GB
tool-cache: true
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pip
run: python -m pip install -U pip
- name: Install package
run: python -m pip install -e .[ml,dev,test]
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context
- name: Set Env (Windows)
if: runner.os == 'Windows'
run: |
echo "KERAS_BACKEND=${{ matrix.backend }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- name: Set Env (Linux)
if: runner.os == 'Linux'
run: |
echo "KERAS_BACKEND=${{ matrix.backend }}" >> $GITHUB_ENV
- name: Set Env (Mac)
if: runner.os == 'macOS'
run: |
echo "KERAS_BACKEND=${{ matrix.backend }}" >> $GITHUB_ENV
echo "PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0" >> $GITHUB_ENV
# Run keras backend specific tests (for keras>=3)
# Due to space issues avoid creating too many venvs (via tox)
# see https://github.com/actions/runner-images/issues/709
- name: Run tests - ${{ matrix.backend }} backend
run: |
pytest -v --timeout=120 --cov=damast --cov-report=term --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.backend }}.xml tests
- name: Upload pytest results
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.backend }}
path: junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.backend }}.xml
# Publish also in case of test failures
if: always()