adding macos to test pipeline #364
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# github action including pymongo see https://github.com/marketplace/actions/mongodb-in-github-actions | |
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python-version: [ '3.8', '3.9' , '3.10'] | |
mongodb-version: ['5.0', '6.0'] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set Up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pandoc for ubuntu | |
if: startsWith(matrix.os, 'ubuntu-') | |
run: | | |
sudo apt-get install -y pandoc | |
- name: Install choco for windows | |
if: startsWith(matrix.os, 'windows-') | |
run: choco install pandoc -y | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install pymongo | |
# - name: Install MongoDB (Windows) # see: https://github.com/ankane/setup-mongodb | |
# if: startsWith(matrix.os, 'windows-') | |
# uses: ankane/setup-mongodb@v1 | |
# with: | |
# mongodb-version: 5.0 | |
- name: Start MongoDB (Linux) | |
if: startsWith(matrix.os, 'ubuntu-') | |
uses: supercharge/mongodb-github-action@1.3.0 | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
- name: Run pytest coverage | |
run: | | |
pytest --cov --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- |