Merge pull request #7 from chekos:audio-features-id-files #57
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: Test | |
on: | |
push: | |
paths-ignore: | |
- '.github/**' | |
workflow_dispatch: | |
env: | |
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }} | |
SPOTIFY_AUTH_STRING: ${{ secrets.SPOTIFY_AUTH_STRING }} | |
USERNAME: ${{ secrets.USERNAME }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
REDIRECT_URI: ${{ secrets.REDIRECT_URI }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
if: hashFiles('setup.py') | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: '**/setup.py' | |
- name: Cache playwright | |
id: cache-playwright | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/ms-playwright/ | |
key: ${{ runner.os }}-browsers | |
- name: Cache Spotify info | |
uses: actions/cache@v3 | |
with: | |
path: ~/.config/esporifai | |
key: ${{ runner.os }}-spotify-v2 | |
- name: Install dependencies | |
if: hashFiles('setup.py') | |
run: | | |
pip install -e '.[test]' | |
- name: Install Chromium | |
if: steps.cache-playwright.outputs.cache-hit != 'true' | |
run: | | |
playwright install chromium | |
- name: Auth check | |
run: | | |
if [ "$(esporifai auth --check)" ] | |
then | |
echo "Credentials already present." | |
else | |
echo "Authorizing" | |
esporifai auth --force | |
fi | |
- name: Run tests | |
if: hashFiles('setup.py') | |
run: | | |
pytest |