diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml new file mode 100644 index 0000000..a6f52be --- /dev/null +++ b/.github/workflows/CI.yaml @@ -0,0 +1,60 @@ +name: CI + +on: + # GitHub has started calling new repo's first branch "main" https://github.com/github/renaming + # The cookiecutter uses the "--initial-branch" flag when it runs git-init + push: + branches: + - "ga" + pull_request: + branches: + - "master" + schedule: + # Weekly tests run on main by default: + # Scheduled workflows run on the latest commit on the default or base branch. + # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) + - cron: "0 0 * * 0" + +jobs: + test: + name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: [3.9, "3.10", 3.11] + + steps: + - uses: actions/checkout@v4 + + - name: Additional info about the build + shell: bash + run: | + uname -a + df -h + ulimit -a + + - uses: mamba-org/setup-micromamba@v1 + with: + environment-file: devtools/conda-envs/test_env.yaml + condarc: | + channels: + - conda-forge + create-args: >- + python=${{ matrix.python-version }} + + - name: Install package + run: | + python -m pip install . --no-deps + + - name: Run tests + shell: bash -l {0} + run: | + pytest -v -m "not slow" --cov=mosdef_cassandra --cov-report=xml --color=yes mosdef_cassandra/tests/ + + - name: Codecov + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml + flags: unittests + name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} \ No newline at end of file diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index 3272e6c..0000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Black formatting check - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "black" - black: - # The type of runner that the job will run on - runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - # Run the black code formatter - - name: Black Code Formatter - uses: mflaxman/black-action@v1.0.2 - with: - args: ". --check" diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index d357088..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,162 +0,0 @@ - -trigger: -- master - -pr: - autoCancel: true - branches: - include: - - master - -schedules: -- cron: "0 0 * * *" - displayName: Daily midnight build for master - branches: - include: - - master - always: true - -jobs: -- job: BleedingMoSDeF - strategy: - matrix: - Python310Ubuntu: - imageName: 'ubuntu-22.04' - python.version: 3.10 - Python311Ubuntu: - imageName: 'ubuntu-22.04' - python.version: 3.11 - Python10macOS: - imageName: 'macOS-14' - python.version: 3.10 - Python311macOS: - imageName: 'macOS-14' - python.version: 3.11 - - pool: - vmImage: $(imageName) - - steps: - - bash: echo "##vso[task.prependpath]$CONDA/bin" - displayName: Add Conda to path - - - bash : echo "##vso[task.prependpath]$(Build.SourcesDirectory)/Cassandra-1.3.1/bin" - displayName: Add Cassandra to path - - - bash: | - conda config --set always_yes yes --set changeps1 no - conda config --add channels conda-forge - conda update -c defaults conda - conda update --all - conda create --yes -n bleeding-test-environment python=$(python.version) --file requirements-dev.txt - displayName: Create a new bleeding test environment - - - bash: | - source activate bleeding-test-environment - wget https://github.com/MaginnGroup/Cassandra/archive/v1.3.1.tar.gz - tar -xzvf v1.3.1.tar.gz - cd Cassandra-1.3.1/Src - make -f Makefile.gfortran - mkdir ../bin - cp cassandra_gfortran.exe ../bin/. - cp ../Scripts/Frag_Library_Setup/library_setup.py ../bin/. - cd ../../ - displayName: Build Cassandra - - - bash: | - echo Working directory: - pwd - echo ls: - ls - echo PATH: - echo "$PATH" - echo CASSANDRA: - which cassandra_gfortran.exe - echo PYTHON2 - which python2 - echo LIBRARY_SETUP: - which library_setup.py - displayName: Check cassandra install - - - bash: | - source activate bleeding-test-environment - git clone https://github.com/mosdef-hub/foyer.git - git clone https://github.com/mosdef-hub/mbuild.git - cd foyer - conda install --yes python=$(python.version) --file requirements-dev.txt - python -m pip install --user . - python -m pip uninstall mbuild -y - cd .. - cd mbuild - conda install --yes python=$(python.version) --file requirements-dev.txt - python -m pip install . - cd .. - python -m pip install . - displayName: clone,install foyer,mbuild; install mosdef_cassandra - - - bash: | - source activate bleeding-test-environment - python -m pip install pytest-cov - python -m pip install pytest-azurepipelines - python -m pytest mosdef_cassandra/tests -v --cov=mosdef_cassandra --cov-report=html --pyargs - displayName: Run Tests - - - bash: | - source activate bleeding-test-environment - coverage xml - bash <(curl -s https://codecov.io/bash) -t 022e3719-0209-42d8-ae36-488daf8e4e61 - condition: and( eq( variables['Agent.OS'], 'Linux' ), eq( variables['python.version'], '3.7' ) ) - displayName: Upload coverage - -- job: StandardMoSDeF - strategy: - matrix: - Python39Ubuntu: - imageName: 'ubuntu-20.04' - python.version: 3.9 - Python38Ubuntu: - imageName: 'ubuntu-20.04' - python.version: 3.8 - Python37macOS: - imageName: 'macOS-10.14' - python.version: 3.7 - Python39macOS: - imageName: 'macOS-latest' - python.version: 3.9 - - pool: - vmImage: $(imageName) - - steps: - - bash: echo "##vso[task.prependpath]$CONDA/bin" - displayName: Add Conda to path - - # On Hosted macOS, the agent user doesn't have ownership of Miniconda's installation directory/ - # We need to take ownership if we want to update conda or install packages globally - - bash: sudo chown -R $USER $CONDA - displayName: Take ownership of conda installation - condition: eq( variables['Agent.OS'], 'Darwin' ) - - - bash: | - conda config --set always_yes yes --set changeps1 no - conda config --add channels conda-forge - conda update -c defaults conda - conda update --all - conda create --yes -n test-environment python=$(python.version) --file requirements-test.txt - displayName: Create a new test environment - - - bash: | - source activate test-environment - echo "PYTHON VERSION:" - python --version - echo "CASSANDRA EXEC:" - which cassandra.exe - python -m pip install --user . - displayName: clone,install foyer,mbuild; install mosdef_cassandra - - - bash: | - source activate test-environment - python -m pip install --user pytest-azurepipelines - python -m pytest mosdef_cassandra/tests -v - displayName: Run Tests - diff --git a/devtools/conda-envs/dev_env.yaml b/devtools/conda-envs/dev_env.yaml new file mode 100644 index 0000000..474dfbd --- /dev/null +++ b/devtools/conda-envs/dev_env.yaml @@ -0,0 +1,24 @@ +name: dev_env +channels: + - conda-forge + - defaults +dependencies: + # Base depends + - python + - networkx + - pytest + - pytest-cov + - pandas + - unyt + - foyer + - mbuild + - gmso >= 0.11.1 + - pycifrw + - garnett + - constrainmol + - parmed + - cassandra + - openbabel + - black + - sphinx + - shinx_rtd_theme \ No newline at end of file diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml new file mode 100644 index 0000000..7747cb9 --- /dev/null +++ b/devtools/conda-envs/test_env.yaml @@ -0,0 +1,20 @@ +name: test +channels: + - conda-forge + - defaults +dependencies: + # Base depends + - python + - networkx + - pytest + - pytest-cov + - pandas + - unyt + - foyer + - mbuild + - gmso >= 0.11.1 + - pycifrw + - garnett + - constrainmol + - parmed + - cassandra \ No newline at end of file