forked from ringcentral/ringcentral-python
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 1.28 KB
/
unit-tests.yml
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Unit Tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version}}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Test with pytest
env:
RINGCENTRAL_SERVER_URL: ${{secrets.RINGCENTRAL_SERVER_URL}}
RINGCENTRAL_CLIENT_ID: ${{secrets.RINGCENTRAL_CLIENT_ID}}
RINGCENTRAL_CLIENT_SECRET: ${{secrets.RINGCENTRAL_CLIENT_SECRET}}
RINGCENTRAL_JWT_TOKEN: ${{secrets.RINGCENTRAL_JWT_TOKEN}}
run: |
#Create virtual environment
python -m venv venv
#Activate virtual environment
source venv/bin/activate
#Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt
#Run unit tests
coverage run -m unittest discover . --pattern '*test.py'
coverage report