-
Notifications
You must be signed in to change notification settings - Fork 100
49 lines (47 loc) · 1.64 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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]
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.txt
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