🧪📦 Test packages #201
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: 🧪📦 Test packages | |
on: | |
schedule: | |
- cron: "0 7 * * 1" | |
jobs: | |
run-tests-with-pip: | |
name: Run tests with Symfem installed from pip | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: v2024.10.0 | |
name: Get latest Symfem version | |
- run: rm -rf symfem VERSION | |
name: Remove downloaded symfem | |
- name: Install LaTeΧ | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y texlive-latex-base texlive-latex-extra | |
- run: python3 -m pip install CairoSVG | |
name: Install optional dependencies | |
- run: python3 -m pip install symfem | |
name: Install Symfem | |
- run: pip install pytest | |
name: Install pytest | |
- run: python3 -m pytest test/ | |
name: Run unit tests | |
- run: python3 -m pytest demo/test_demos.py | |
name: Run demos | |
run-tests-with-conda: | |
name: Run tests with Symfem installed from conda-forge | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
activate-environment: symfem | |
- uses: actions/checkout@v4 | |
with: | |
ref: v2024.10.0 | |
name: Get latest Symfem version | |
- run: rm -rf symfem VERSION | |
name: Remove downloaded symfem | |
- name: Install LaTeΧ | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y texlive-latex-base texlive-latex-extra | |
- run: | | |
conda config --add channels conda-forge | |
conda config --set channel_priority strict | |
conda install symfem | |
conda install cairosvg | |
conda install pytest | |
pytest test/ | |
pytest demo/test_demos.py | |
shell: bash -l {0} | |
name: Install Symfem and run tests | |
run-test-with-pypi-zip: | |
name: Run tests with Symfem downloaded from PyPI | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: v2024.10.0 | |
path: symfem-src | |
- name: Move tests and delete Symfem source | |
run: | | |
mv symfem-src/test . | |
mv symfem-src/README.md . | |
rm -r symfem-src | |
- run: | | |
wget -O symfem.tar.gz https://pypi.io/packages/source/s/symfem/symfem-2024.10.0.tar.gz | |
tar -xvzf symfem.tar.gz | |
name: Download and unpack latest version of Symfem | |
- name: Install LaTeΧ | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y texlive-latex-base texlive-latex-extra | |
- run: pip install pytest | |
name: Install pytest | |
- run: | | |
cd symfem-2024.10.0 | |
pip install .[optional] | |
name: Install requirements | |
- run: | | |
python3 -m pytest test/ | |
name: Run tests |