Fix workflows and add basic tests. #25
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: Testing | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
name: Tests on (${{ matrix.python-version }}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.10"] | |
include: | |
- os: "ubuntu-latest" | |
installer-url: "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" | |
- os: "macos-latest" | |
installer-url: "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh" | |
- os: "windows-latest" | |
installer-url: "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe" | |
max-parallel: 8 | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: proudust/gh-describe@v2 | |
# id needed to generate the outputs | |
id: ghd | |
- name: Check outputs | |
run: | | |
echo "describe : ${{ steps.ghd.outputs.describe }}" | |
echo "tag : ${{ steps.ghd.outputs.tag }}" | |
echo "distance : ${{ steps.ghd.outputs.distance }}" | |
echo "sha : ${{ steps.ghd.outputs.sha }}" | |
echo "short-sha : ${{ steps.ghd.outputs.short-sha }}" | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
installer-url: ${{ matrix.installer-url }} | |
python-version: ${{ matrix.python-version }} | |
- name: Conda info | |
shell: bash -el {0} | |
run: | | |
conda config --remove channels defaults | |
conda config --add channels mark.harfouche | |
conda info | |
- name: Conda list | |
shell: pwsh | |
run: | | |
conda list | |
- name: Install dependencies | |
shell: bash -el {0} | |
run: | | |
conda install compilers pybind11 numpy openjph setuptools pytest --yes | |
- name: Install package | |
shell: bash -el {0} | |
run: | | |
export OJPH_GIT_DESCRIBE=${{ steps.ghd.outputs.describe }} | |
python -m pip install -e . -vvv | |
- name: Run tests | |
shell: bash -el {0} | |
run: | | |
export OJPH_GIT_DESCRIBE=${{ steps.ghd.outputs.describe }} | |
python --version | |
pip check | |
python -c "import ojph; print(ojph.__version__)" | |
pytest |