Stop double console log on devstart. #111
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: ci | |
on: | |
push: | |
# A branch github-ci-updates can be created and used for ci | |
# experiments and tweaks. | |
branches: [ "develop", "master", "github-ci-updates" ] | |
pull_request: | |
branches: [ "develop", "master" ] | |
permissions: | |
contents: read | |
jobs: | |
# Basic linting and tests. | |
base-ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y mecab mecab-ipadic-utf8 | |
# Helper checks to find the mecab library path, | |
# so it can be exported before running tests. | |
# Without the export, natto-py fails on github. | |
# echo FIND THE LIB: | |
# which mecab | |
# actual=`readlink -f /usr/bin/mecab` | |
# ldd $actual | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' # caching pip dependencies | |
- run: pip install -r requirements.txt | |
- name: Setup config | |
run: | | |
mkdir ${{ github.workspace }}/data | |
echo "ENV: dev" > ${{ github.workspace }}/lute/config/config.yml | |
echo "DATAPATH: ${{ github.workspace }}/data" >> ${{ github.workspace }}/lute/config/config.yml | |
echo "DBNAME: test_lute.db" >> ${{ github.workspace }}/lute/config/config.yml | |
echo "MECAB_PATH: /lib/x86_64-linux-gnu/libmecab.so.2" >> ${{ github.workspace }}/lute/config/config.yml | |
ls ${{ github.workspace }} | |
cat ${{ github.workspace }}/lute/config/config.yml | |
- name: Lint | |
run: inv lint | |
- name: Test | |
run: | | |
# Have to explicitly set MECAB_PATH for natto-py. | |
export MECAB_PATH=/lib/x86_64-linux-gnu/libmecab.so.2 | |
pytest | |
# Note that these seem to *pass* even if an acceptance | |
# test fails in GitHub actions ... which is annoying, | |
# because everything passes/fails correctly locally. | |
- name: Acceptance testing | |
run: | | |
export MECAB_PATH=/lib/x86_64-linux-gnu/libmecab.so.2 | |
inv accept --headless -s | |
- name: Remove mecab for smoke test without mecab | |
run: | | |
sudo apt-get remove -y mecab mecab-ipadic-utf8 | |
# Run one particular sanity check. | |
# | |
# Note this isn't _completely_ valid because the test loads | |
# only supported language stories, whereas a prod release | |
# comes with _all_ stories pre-loaded and the invalid ones | |
# are deleted ... | |
- name: Smoke test no mecab | |
run: inv accept --headless -s -k test_unsupported_language_not_shown |