Run pytest on macOS #898
Workflow file for this run
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: pytest-macos | |
run-name: Run pytest on macOS | |
on: | |
push: | |
branches: 'main' | |
pull_request: | |
jobs: | |
pytest: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.12"] | |
name: pytest-macos-python-${{ matrix.python-version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Prepare system | |
run: | | |
rm -f '/usr/local/bin/2to3' # Homebrew will fail if this exists | |
- name: Install Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up Homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Install Homebrew dependencies | |
run: | | |
rm -f /usr/local/bin/2to3* /usr/local/bin/python3* /usr/local/bin/idle3* \ | |
/usr/local/bin/pydoc3* # Homebrew will fail if these exist | |
brew install gnu-time coreutils diffutils dpkg ghostscript texlive virtualenv | |
- name: Install Python dependencies | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
pip install .[tests] | |
- name: Run pytest | |
env: | |
PYTEST_ADDOPTS: "--color=yes" | |
run: | | |
source .venv/bin/activate | |
pytest -v --time-tool time |