Merge pull request #301 from IlyaSkriblovsky/master #7
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
name: Tests against selected versions of Python and MongoDB | |
on: [push] | |
jobs: | |
basic: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.12'] | |
mongodb-version: ['4.0', '4.2', '4.4', '8.0'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Start MongoDB on port 27017 | |
uses: supercharge/mongodb-github-action@1.11.0 | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install tox | |
run: pip install tox | |
- name: Run basic tests in tox | |
run: tox -f py${{ matrix.python-version }} basic | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report-${{ matrix.mongodb-version }}-${{ matrix.python-version }} | |
path: htmlcov | |
advanced: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ['3.8'] | |
mongodb-version: ['8.0'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install MongoDB ${{ matrix.mongodb-version }} | |
run: | | |
wget -qO - https://www.mongodb.org/static/pgp/server-${{ matrix.mongodb-version }}.asc | sudo apt-key add - | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/${{ matrix.mongodb-version }} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${{ matrix.mongodb-version }}.list | |
sudo apt-get update | |
sudo apt-get install -y --allow-downgrades mongodb-org-server | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install tox and any other packages | |
run: pip install tox | |
- name: Run advanced tests in tox | |
run: tox -f py${{ matrix.python-version }} advanced | |
advanced_old_mongo: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ['3.8'] | |
mongodb-version: ['4.0'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install MongoDB ${{ matrix.mongodb-version }} | |
run: | | |
wget -qO - https://www.mongodb.org/static/pgp/server-${{ matrix.mongodb-version }}.asc | sudo apt-key add - | |
echo "deb [ trusted=yes arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/${{ matrix.mongodb-version }} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${{ matrix.mongodb-version }}.list | |
sudo apt-get update | |
sudo apt-get install -y --allow-downgrades mongodb-org-server | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install tox and any other packages | |
run: pip install tox | |
- name: Run advanced tests in tox | |
run: tox -f py${{ matrix.python-version }} advanced |