-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from xiaoruiDong/tests
Update testings
- Loading branch information
Showing
15 changed files
with
670 additions
and
536 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[run] | ||
branch = True | ||
source = rdmc | ||
omit = | ||
rdmc/external/GeoMol/* | ||
rdmc/external/rmg.py | ||
rdmc/external/xyz2mol.py | ||
rdmc/conformer_generation/* | ||
|
||
[report] | ||
show_missing = False | ||
exclude_lines = | ||
def __repr__ | ||
logger.warning | ||
if __name__ == .__main__.: | ||
omit = | ||
rdmc/external/GeoMol/* | ||
rdmc/external/rmg.py | ||
rdmc/external/xyz2mol.py | ||
rdmc/conformer_generation/* | ||
|
||
[html] | ||
directory = ./coverage/html | ||
|
||
[xml] | ||
output = ./coverage/coverage.xml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: "0 8 * * *" | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: actions-id-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-formatting: | ||
name: Check Formatting Errors | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install pycodestyle | ||
- name: Run pycodestyle | ||
run: | | ||
pycodestyle --statistics \ | ||
--count \ | ||
--max-line-length 150 \ | ||
--max-doc-length 200 \ | ||
--ignore=E266,E501,W503,W505 \ | ||
--show-source \ | ||
. | ||
build-and-test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
name: ${{ matrix.os }} Python ${{ matrix.python-version }} Subtest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: rdmc_env | ||
environment-file: environment.yml | ||
miniforge-variant: mambaforge | ||
miniforge-version: latest | ||
python-version: ${{ matrix.python-version }} | ||
auto-activate-base: true | ||
use-mamba: true | ||
|
||
- name: Install RDMC | ||
run: python -m pip install --no-deps -vv ./ | ||
|
||
- name: Install Pytest | ||
run: mamba install -y pytest pytest-cov pytest-check | ||
|
||
- name: Mamba info | ||
run: | | ||
mamba info | ||
mamba list | ||
- name: Run Unit Tests | ||
run: pytest | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }} | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
directory: ./coverage |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[pytest] | ||
required_plugins = | ||
pytest-cov | ||
pytest-check | ||
filterwarnings = | ||
ignore:.*escape seq.*:DeprecationWarning | ||
addopts = | ||
--keep-duplicates | ||
-vv | ||
--cov=rdmc | ||
--cov-config .coveragerc | ||
--cov-report html | ||
--cov-report xml | ||
--cov-report term | ||
testpaths = test | ||
python_files = test_*.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- |
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
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
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
Oops, something went wrong.