upgrade lint and test checks #324
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: Test | |
on: | |
# Trigger the workflow on push or pull request, | |
# but only for the main branch | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
strategy: | |
max-parallel: 20 | |
matrix: | |
os: [ macos-latest ] | |
python-version: [ '3.9', '3.10' ] | |
# This distribution of tests is designed to ensure an approximately even time to finish for parallel jobs. | |
pkg: | |
- tests --ignore=tests/test_mdgopackmol.py | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v4 | |
if: startsWith(runner.os, 'macOS') | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- uses: actions/cache@v4 | |
if: startsWith(runner.os, 'Windows') | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip wheel | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
pip install -e . | |
- name: Prepare Packmol | |
run: | | |
echo $HOME | |
echo "$HOME/work/mdgo/mdgo/tests/packmol" >> $GITHUB_PATH | |
- name: Prepare Selenium | |
# https://github.com/marketplace/actions/setup-chromedriver | |
uses: nanasess/setup-chromedriver@master | |
- name: Start XVFB | |
run: | | |
export DISPLAY=:99 | |
chromedriver --url-base=/wd/hub & | |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional | |
- name: pytest ${{ matrix.pkg }} | |
run: | | |
pytest ${{ matrix.pkg }} |