1
0

.travis.yml 1.4 KB

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