-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 1.6 KB
/
Copy pathcode_coverage.yml
File metadata and controls
46 lines (45 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Running Code Coverage
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python 3.10
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Install FFmpeg
run: |
sudo apt update
sudo apt install -y ffmpeg
- name: Verify FFmpeg installation
run: ffmpeg -version
- name: Install dependencies
run: |
pip install pytest-cov
echo requirements installed
- name: Run the tests
env:
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }}
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }}
REDDIT_USER_AGENT: ${{ secrets.REDDIT_USER_AGENT }}
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
SCRAPEOPS_API_SECRET: ${{ secrets.SCRAPEOPS_API_SECRET }}
run: |
pip install -r requirements.txt
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('vader_lexicon')"
export PYTHONPATH=$PYTHONPATH:$(pwd)
python ./sentimental_analysis/manage.py makemigrations
python ./sentimental_analysis/manage.py migrate
pytest --cov=sentimental_analysis --cov-config=test/.coveragerc --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
verbose: true
env:
# CODECOV_TOKEN must be set up as a repository secret
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}