nabboot: support kernel 6.x #1077
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: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
test_suite: | |
name: Run test suite | |
runs-on: ubuntu-latest | |
# Service containers | |
services: | |
postgres: | |
image: postgres | |
# Provide the password for postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
strategy: | |
fail-fast: false | |
matrix: | |
python: [3.7, 3.9] | |
steps: | |
- name: Checkout pynab | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Set up Rust | |
uses: hecrj/setup-rust-action@v1 | |
with: | |
rust-version: 1.61.0 | |
- name: Install dependencies | |
run: | | |
sudo apt update -y | |
sudo apt-get install -y libasound2-dev libmpg123-dev libatlas-base-dev curl | |
wget -q -O install_mkl.sh https://raw.githubusercontent.com/pguyot/kaldi/e4940d045d39deb86016bc176893303b5240ff59/tools/extras/install_mkl.sh | |
sudo bash install_mkl.sh | |
wget -q -O - "https://github.com/pguyot/kaldi/releases/download/e4940d045/kaldi-e4940d045-linux_ubuntu20.04-x86_64.tar.xz" | sudo tar xJ -C / | |
sudo ldconfig | |
python -m pip install --upgrade pip | |
pip install Cython==0.29.30 numpy==1.21.4 setuptools_rust wheel | |
- name: Install requirements | |
run: pip install -r requirements.txt | |
- name: Install kaldi models | |
run: | | |
sudo mkdir -p /opt/kaldi/model/ | |
sudo tar xJf asr/kaldi-nabaztag-en-adapt-r20191222.tar.xz -C /opt/kaldi/model/ | |
sudo tar xJf asr/kaldi-nabaztag-fr-adapt-r20200203.tar.xz -C /opt/kaldi/model/ | |
- name: Setup PostgreSQL database | |
run: | | |
PGPASSWORD=postgres PGHOST=localhost PGPORT=5432 psql -U postgres -d postgres -c "CREATE USER pynab PASSWORD 'pynab'; ALTER ROLE pynab CREATEDB;" | |
- name: Setup NLU engines | |
run: | | |
python -m snips_nlu download fr | |
python -m snips_nlu download en | |
mkdir -p nabd/nlu | |
python -m snips_nlu generate-dataset en */nlu/intent_en.yaml > nabd/nlu/nlu_dataset_en.json | |
python -m snips_nlu generate-dataset fr */nlu/intent_fr.yaml > nabd/nlu/nlu_dataset_fr.json | |
snips-nlu train nabd/nlu/nlu_dataset_en.json nabd/nlu/engine_en | |
snips-nlu train nabd/nlu/nlu_dataset_fr.json nabd/nlu/engine_fr | |
- name: Fake NTP synchronization | |
run: sudo mkdir -p /run/systemd/timesync/ && sudo touch /run/systemd/timesync/synchronized | |
- name: Check types with mypy | |
run: | | |
mypy nab* | |
- name: Run test suite with coverage | |
run: | | |
PGPASSWORD=pynab PGHOST=localhost PGPORT=5432 coverage run -m pytest |