Skip to content

Fix: Build AC root directory to avoid error with with_tags=True. #281

Fix: Build AC root directory to avoid error with with_tags=True.

Fix: Build AC root directory to avoid error with with_tags=True. #281

# Template: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package using Pip
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
env:
CACHE_NUMBER: 0 # increase to reset cache manually
# Cancel workflow if a new push occurs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.11"]
steps:
# --- INSTALLATIONS ---
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install package
shell: bash
# note: ${GITHUB_REF##*/} gives the branch name
# note 2: dev is NOT the branch here, but the dev dependencies
run: |
python -m pip install "aac-datasets[dev] @ git+https://github.com/Labbeti/aac-datasets@${GITHUB_REF##*/}"
- name: Install soundfile for torchaudio, ffmpeg and yt-dlp for AudioCaps download
run: |
sudo apt-get update
sudo apt-get install libsndfile1
sudo apt-get install ffmpeg yt-dlp
# --- TESTS ---
- name: Compile python files
run: |
python -m compileall src
- name: Lint with flake8
run: |
python -m flake8 --config .flake8 --exit-zero --show-source --statistics src
- name: Check format with Black
run: |
python -m black --check --diff src
- name: Print install info
run: |
aac-datasets-info
- name: Test with pytest
run: |
python -m pytest -v
- name: Build data root
run: |
mkdir -p ~/.cache/aac-datasets
- name: Try to download Clotho val
run: |
aac-datasets-download --root ~/.cache/aac-datasets --verbose 2 clotho --subsets val
- name: Try to download AudioCaps val
run: |
aac-datasets-download --root ~/.cache/aac-datasets --verbose 2 audiocaps --subsets val