Update tests.yml #2356
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: Tests | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
strategy: | |
max-parallel: 4 | |
matrix: | |
os: [macos-14, ubuntu-latest] | |
# os: [macos-14] | |
python-version: ['3.10', '3.11', '3.12'] | |
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' # caching pip dependencies | |
- name: Activate virtualenv | |
run: | | |
python3 -m venv .venv | |
. .venv/bin/activate | |
echo PATH=$PATH >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r dev_requirements.txt | |
python3 -m pip install -r requirements.txt | |
- name: Install exiftool | |
run: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/runner/.bash_profile | |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | |
export PATH=/home/linuxbrew/.linuxbrew/bin:$PATH | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
echo "macOS: brew should already be on path" | |
else | |
echo "$RUNNER_OS not supported" | |
exit 1 | |
fi | |
brew install exiftool | |
- name: Test with pytest | |
run: | | |
python -m pytest -v tests/ | |
- name: Send failure notification | |
if: ${{ failure() }} | |
run: | | |
curl \ | |
-H "Click: https://github.com/RhetTbull/osxphotos/actions/" \ | |
-d "osxphotos test failed" \ | |
ntfy.sh/rhettbull_github_actions |