1
0

.travis.yml 1.3 KB

12345678910111213141516171819202122232425262728
  1. language: python
  2. python:
  3. - 3.7
  4. before_install:
  5. - sudo apt remove *mysql*
  6. - sudo apt install software-properties-common gnupg-curl apt-transport-https
  7. - sudo apt-key adv --fetch-keys 'http://mariadb.org/mariadb_release_signing_key.asc'
  8. - sudo add-apt-repository 'deb [arch=amd64,arm64,i386,ppc64el] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.5/ubuntu xenial main'
  9. - sudo apt update
  10. - sudo apt install mariadb-client mariadb-server mariadb-common libmariadb-dev libmariadb3
  11. - mysql --version
  12. - python --version
  13. - pip install -U pip
  14. - pip install -U codecov
  15. - pip install -U pytest-cov
  16. install:
  17. - pip install -r requirements.txt
  18. - sudo mariadb-upgrade
  19. - sudo sed -i '/\[mysqld\]/ a event_scheduler=ON\nuserstat=1\nperformance_schema=ON' /etc/mysql/mariadb.conf.d/50-server.cnf
  20. - sudo systemctl restart mariadb
  21. - sudo mariadb < extra/myanimebot-init.sql
  22. - sudo mariadb -e "CREATE USER IF NOT EXISTS 'myanimebot'@'localhost' IDENTIFIED BY 'myPassword'; GRANT ALL PRIVILEGES ON myanimebot.* TO 'myanimebot'@'localhost'; FLUSH PRIVILEGES;"
  23. - sed 's/token = 123456789ABCDEF987654321FEDCBA/token = '"$DISCORD_TOKEN"'/' myanimebot.example.conf > myanimebot.conf
  24. - mkdir "logs"
  25. script:
  26. - python -m pytest tests --cov=. # run tests
  27. after_success:
  28. - bash <(curl -s https://codecov.io/bash) # submit coverage