.travis.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. os: linux
  2. dist: xenial
  3. language: python
  4. python:
  5. - 3.7
  6. before_install:
  7. - sudo apt remove *mysql*
  8. - sudo apt install software-properties-common gnupg-curl apt-transport-https
  9. - sudo apt-key adv --fetch-keys 'http://mariadb.org/mariadb_release_signing_key.asc'
  10. - sudo add-apt-repository 'deb [arch=amd64,arm64,i386,ppc64el] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.5/ubuntu xenial main'
  11. - sudo apt update
  12. - sudo apt install mariadb-client mariadb-server mariadb-common libmariadb-dev libmariadb3
  13. - mysql --version
  14. - sudo mariadb-upgrade
  15. - sudo sed -i '/\[mysqld\]/ a default_time_zone='"'"'+1:00'"'"'\nevent_scheduler=ON\nuserstat=1\nperformance_schema=ON' /etc/mysql/mariadb.conf.d/50-server.cnf
  16. - sudo systemctl restart mariadb
  17. - python --version
  18. install:
  19. - pip install -r requirements.txt
  20. - pip install -U codecov
  21. - pip install -U pytest-cov
  22. script:
  23. # Import of the database architecture
  24. - sudo mariadb < extra/myanimebot-init.sql
  25. # Creation of the user for the application
  26. - sudo mariadb -e "CREATE USER IF NOT EXISTS '$DB_USER'@'$DB_HOST' IDENTIFIED BY '$DB_PASSWORD'; GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'$DB_HOST'; FLUSH PRIVILEGES;"
  27. - mkdir "logs"
  28. # Create conf
  29. - envsubst < myanimebot.example.conf > myanimebot.conf
  30. # Run tests
  31. - python -m pytest tests --cov=.
  32. after_success:
  33. # Submit coverage
  34. - bash <(curl -s https://codecov.io/bash)