Skip to content

Hirshfeld Automation #974

Hirshfeld Automation

Hirshfeld Automation #974

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: ci-tests
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
# Only running on master in case there are direct merges
branches: [ main ]
#branches: [ master, ReactAims_documentation, harry_branch, cube_file_read, jack_molecules, ob ]
pull_request:
# Run on all pull requests when updated.
# 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 "build"
build:
# This allows us to find the workflow in checks
name: ci-test-build
# 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
# Ensure we are running Python v3.x
- name: Set up Python
uses: actions/setup-python@v1
with:
# Issues with bdist_wheel on v3.9
#python-version: '3.x'
python-version: '3.7'
# Install ASE so we can run our tests
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade ase
python -m pip install --upgrade catlearn
python -m pip install --upgrade ase-gpatom
python -m pip install --upgrade pytest
python -m pip install --upgrade pytest-cov
python -m pip install torch torchvision torchaudio
python -m pip install --upgrade mace-torch
python -m pip install pymatgen
# Setup Python environment
- name: Setup Python environment
run: |
# This is debug, as setting the Python Path wasn't obvious.
# echo $PWD
# ls -lrt
# env | sort
#
# This is depreciated. It can be over-ridden with:
# echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV
# echo "::set-env name=PYTHONPATH::/home/runner/work/carmm/carmm"
#
# Example new implementation from: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files
echo "PYTHONPATH=/home/runner/work/carmm/carmm:$PYTHONPATH" >> $GITHUB_ENV
# # Look for codebreaking syntax errors and highlight style errors
# - name: Lint with flake8
# run: |
# pip install flake8
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Runs a set of commands using the runners shell
# Updated to run on pytest so we might be able to export data
- name: Run the examples
run: |
cd examples
pytest --cov=../ --cov-report=xml *.py
# Upload all the data on coverage to CodeCov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./examples/coverage.xml
flags: unittests