Bump versions #116
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
name: Horace-Euphonic-Interface Tests | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master, development] | |
types: [opened, reopened, synchronize] | |
workflow_dispatch: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
matlab_version: [latest] | |
python_version: [3.11] | |
euphonic_version: [''] | |
# Test lowest supported Python/Euphonic versions, and lowest available Matlab | |
include: | |
- os: ubuntu-latest | |
matlab_version: R2021b | |
python_version: 3.9 | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} # Needed to use conda environments | |
steps: | |
- name: Check out Horace-Euphonic-Interface | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up MATLAB | |
uses: matlab-actions/setup-matlab@v2 # v1.1.0 required for Windows/MacOS support | |
with: | |
release: ${{ matrix.matlab_version }} | |
- name: Set up Python | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python_version }} | |
auto-update-conda: true | |
conda-solver: libmamba | |
channels: conda-forge | |
- name: Set up Python environment (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
shell: powershell | |
run: | | |
# Uses Conda libraries as pip libs give segfault on Windows with Brille | |
conda install euphonic scipy psutil pyyaml h5py requests | |
python -m pip install brille | |
$pypath = (Get-Command python).Path | |
echo "PYTHON_EX_PATH=$pypath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Set up Python environment (Linux) | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
python -m pip install requests psutil numpy==1.26.4 euphonic[phonopy_reader,brille] | |
echo "PYTHON_EX_PATH=`which python`" >> $GITHUB_ENV | |
- name: Create Matlab toolbox | |
run: python create_mltbx.py | |
- name: create_toolbox | |
uses: matlab-actions/run-command@v2 | |
with: | |
command: cd('mltbx'); create_mltbx() | |
- name: Run tests with base Euphonic | |
uses: matlab-actions/run-command@v2 | |
with: | |
command: cd('test'); set_up_dependencies; run_tests('not', 'phonopy_reader', 'not', 'brille') | |
- name: Run tests with Euphonic and phonopy_reader | |
uses: matlab-actions/run-command@v2 | |
with: | |
command: cd('test'); set_up_dependencies; run_tests('phonopy_reader') | |
- name: Run tests with Euphonic and Brille | |
uses: matlab-actions/run-command@v2 | |
with: | |
command: cd('test'); set_up_dependencies; run_tests('brille') | |
- uses: codecov/codecov-action@v3 | |
if: ${{ always() && matrix.os == 'ubuntu-latest' && matrix.matlab_version == 'latest' }} | |
with: | |
directory: test | |
files: coverage*.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload toolbox | |
if: ${{ always() && matrix.os == 'ubuntu-latest' && matrix.matlab_version == 'latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: horace_euphonic_interface.mltbx | |
path: mltbx/horace_euphonic_interface.mltbx | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Unit test results ${{ matrix.os }} | |
path: test/junit_report*.xml | |
publish-test-results: | |
needs: test | |
runs-on: ubuntu-latest | |
if: success() || failure() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Publish test results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
junit_files: artifacts/**/junit_report*.xml |