Skip to content

Commit

Permalink
update all test actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Nov 9, 2022
1 parent 10b3d9a commit b770dac
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 340 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/full_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9]
python-version: ["3.8", "3.9"]
mongodb-version: ['4.0']

runs-on: ubuntu-latest
Expand All @@ -34,19 +34,22 @@ jobs:
mongodb-version: ${{ matrix.mongodb-version }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install Python dependencies
shell: bash -l {0}
run: |
python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools
python${{ matrix.python-version }} -m piptools sync --user requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt
# Using non-editable install for testing building of MANIFEST files
python${{ matrix.python-version }} -m pip install .
- name: Run full tests including dataset downloads
run: |
# Sleeping to allow mongo a bit more time to boot, avoiding connect errors
sleep 10
mongo localhost/admin --eval 'db.createUser({user: "admin",pwd: "password",roles: [ { role: "root", db: "admin" } ]})'
python3 -m venv test_env
. test_env/bin/activate
python -m pip install --upgrade pip
pip install -r requirements-extras.txt
# Using non-editable install for testing building of MANIFEST files
pip install .
pytest --cov=matminer matminer
python${{ matrix.python-version }} -m pytest --cov=matminer matminer
17 changes: 8 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,23 @@ on: [push, pull_request]

jobs:
build:
# prevent this action from running on forks
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: [3.9]
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: requirements-extras.txt
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-extras.txt --quiet
python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools
python${{ matrix.python-version }} -m piptools sync --user requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt
# - name: mypy
# run: |
# mypy --version
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9]
python-version: ["3.8", "3.9"]
mongodb-version: ['4.0']

runs-on: ubuntu-latest
Expand All @@ -25,26 +25,29 @@ jobs:
MPLBACKEND: "Agg"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.6.0
with:
mongodb-version: ${{ matrix.mongodb-version }}

- name: Install Python dependencies
shell: bash -l {0}
run: |
python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools
python${{ matrix.python-version }} -m piptools sync --user requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt
# Using non-editable install for testing building of MANIFEST files
python${{ matrix.python-version }} -m pip install .
- name: Run tests
run: |
# Sleeping to allow mongo a bit more time to boot, avoiding connect errors
sleep 10
mongo localhost/admin --eval 'db.createUser({user: "admin",pwd: "password",roles: [ { role: "root", db: "admin" } ]})'
python3 -m venv test_env
. test_env/bin/activate
python -m pip install --upgrade pip
pip install -r requirements-extras.txt
# Using non-editable install for testing building of MANIFEST files
pip install .
pytest --cov=matminer matminer
python${{ matrix.python-version }} -m pytest --cov=matminer matminer
Loading

0 comments on commit b770dac

Please sign in to comment.