Skip to content

Add files via upload #60

Add files via upload

Add files via upload #60

Workflow file for this run

name: Test TeachersPetBot
on:
push:
branches:
- main
- pylint
pull_request:
branches:
- main
- pylint
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with pylint
run: |
pylint src
- name: Create env file
run: |
cat << EOF > .env
DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }}
TESTING_BOT_TOKEN=${{ secrets.TESTING_BOT_TOKEN }}
TEST_GUILD_ID=${{ secrets.TEST_GUILD_ID }}
DICORD_BOT_NAME=${{ secrets.DICORD_BOT_NAME }}
TEST_BOT_APP_ID=${{ secrets.TEST_BOT_APP_ID }}
TEST_BOT_NAME=${{ secrets.TEST_BOT_NAME }}
USERNAME=${{ secrets.USERNAME }}
TEST_RECIPIENT_EMAIL=${{ secrets.TEST_RECIPIENT_EMAIL }}
PASSWORD=${{ secrets.PASSWORD }}
VERSION=${{ secrets.VERSION }}
EOF
- name: Run tests and collect coverage
run: |
(sleep 2; python3 -m pytest test/tests.py) & (coverage run --source=./src -m pytest src/bot.py )
coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}