-
-
Notifications
You must be signed in to change notification settings - Fork 48
131 lines (113 loc) · 4.25 KB
/
check_acpype.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: check_acpype
on:
push:
branches:
- master
pull_request:
branches:
- master
paths:
- "acpype/**"
- "tests/**"
jobs:
check-test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# - name: Python Poetry Action
# uses: abatilo/[email protected]
- name: Cache pip
uses: actions/cache@v3
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Set Env
run: |
echo "PYTEST_ADDOPTS=--random-order" >> $GITHUB_ENV
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
echo "AMBERHOME=$PWD/acpype/amber_linux" >> $GITHUB_ENV
echo "$PWD/acpype/amber_linux/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends tzdata libarpack++2-dev
- name: Install OpenBabel
run: |
sudo apt-get install --no-install-recommends -y openbabel
- name: Poetry install dependencies
run: |
pip3 install poetry
# poetry add openbabel-wheel
poetry run pip3 install openbabel-wheel
poetry install
which obabel
ldd $(which obabel)
obabel -:"cccc" -o pdb
which antechamber
ldd /home/runner/work/acpype/acpype/acpype/amber_linux/bin/wrapped_progs/antechamber
antechamber -h
- name: Lint with flake8
run: poetry run flake8 -v --count
- name: Check format with black
run: poetry run black --diff --check .
- name: Run isort
run: poetry run isort . --check-only --profile black
- name: Test with PyTest
run: |
poetry run pytest --color=yes --cov=acpype --cov=tests --cov-report=xml
- name: Upload coverage to Codecov
if: matrix.python-version == 3.7
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
release:
needs: check-test
runs-on: ubuntu-20.04
steps:
- name: Get current date
id: vdate
run: echo "adate=$(date +'%Y.%-m.%-d')" >> $GITHUB_OUTPUT
- name: Create tag
# will only create a new release if the commit message is 'new_release' to master branch
if: github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, 'new_tag')
uses: actions/github-script@v6
with:
# github-token: ${{ github.token }} # optional
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.vdate.outputs.adate }}",
sha: context.sha
})
- name: Create Release
# will only create a new release if the commit message is 'new_release' to master branch
if: github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, 'new_release')
id: create_release
# uses: elgohr/Github-Release-Action@v5
uses: softprops/action-gh-release@v1
# uses: actions/create-release@v1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# title: ${{ steps.date.outputs.date }}
tag_name: ${{ steps.vdate.outputs.adate }}
# release_name: Release ${{ steps.vdate.outputs.adate }}
name: Release ${{ steps.vdate.outputs.adate }}
draft: false
prerelease: false