Run tests #97
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: Run tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
schedule: | |
- cron: "33 3 15 * *" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Create .env file | |
shell: bash | |
env: | |
SPOTIPY_CLIENT_ID: ${{ secrets.SPOTIPY_CLIENT_ID }} | |
SPOTIPY_CLIENT_SECRET: ${{ secrets.SPOTIPY_CLIENT_SECRET }} | |
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }} | |
run: | | |
touch neodeemer/.env | |
echo SPOTIPY_CLIENT_ID="$SPOTIPY_CLIENT_ID" >> neodeemer/.env | |
echo SPOTIPY_CLIENT_SECRET="$SPOTIPY_CLIENT_SECRET" >> neodeemer/.env | |
echo YOUTUBE_API_KEY="$YOUTUBE_API_KEY" >> neodeemer/.env | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Download dependencies | |
shell: bash | |
run: | | |
python3 -m pip install -r neodeemer/requirements.txt | |
- name: Test with unittest | |
shell: bash | |
run: | | |
python3 -m unittest discover -v -s tests |