Testing #93
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: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * 0" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docs: | |
name: Build docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: "**/pyproject.toml" | |
- name: Install Uqbar | |
run: pip install -e .[docs] | |
- name: Install Graphviz | |
run: sudo apt-get install --yes graphviz | |
- name: Build docs | |
run: make docs | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: "**/pyproject.toml" | |
- name: Install Uqbar | |
run: pip install -e .[test] | |
- name: Test black | |
run: make black-check | |
- name: Test flake8 | |
run: make flake8 | |
- name: Test mypy | |
run: make mypy | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
include: | |
- os: macos-latest | |
python-version: "3.11" | |
- os: windows-latest | |
python-version: "3.11" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: "**/pyproject.toml" | |
- name: Install Uqbar | |
run: pip install -e . | |
- name: Check importability | |
run: python -c "import uqbar" | |
- name: Install test dependencies | |
run: pip install -e .[test] | |
- name: Install Graphviz | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt-get install --yes graphviz | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
brew install graphviz | |
elif [ "$RUNNER_OS" == "Windows" ]; then | |
choco install graphviz | |
fi | |
shell: bash | |
- name: Run pytest | |
run: pytest --cov uqbar |