Minimum Dependencies #251
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: Minimum Dependencies | |
# Installs the minimum versions of the dependencies and runs the tests. | |
# This test will lower the chance that users botch their installation by | |
# only upgrading this project but not the dependencies. | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
# Allows you to run this workflow manually from the Actions tab. | |
workflow_dispatch: | |
# Allow this workflow to be called from other repositories. | |
workflow_call: | |
schedule: | |
- # Run every day at 5:00 UTC. | |
- cron: "0 5 * * *" | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
# Keep python-version on the lowest version from pyproject.toml. | |
# Also update the regexp below. | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
# Hardcode the minimum version of the dependencies. | |
# E.g. '"astropy>=4.0"' to '"astropy==4.0"' | |
# -i cannot be used because that is hard to get compatible with | |
# Linux, MacOS, and Windows. | |
# Single quotes are necessary for Windows compatibility. | |
sed 's/>=/==/g' pyproject.toml > pyproject.toml.new | |
cp pyproject.toml.new pyproject.toml | |
# It is difficult to make a regexp that generalizes the Python | |
# version and also works Linux, Windows, and MacOS. | |
sed 's/==3.9/==3.9.*/g' pyproject.toml > pyproject.toml.new2 | |
cp pyproject.toml.new2 pyproject.toml | |
python -m pip install --upgrade pip | |
pip install .[test] | |
- name: Run Pytest | |
run: pytest |