-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/SMTG-UCL/ShakeNBreak int…
…o develop
- Loading branch information
Showing
138 changed files
with
298,616 additions
and
299,816 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,14 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
groups: | ||
python-packages: | ||
patterns: | ||
- "*" | ||
open-pull-requests-limit: 2 | ||
allow: | ||
- dependency-type: direct | ||
- dependency-type: indirect |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
name: Release and publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
workflow_run: | ||
workflows: [ "Tests" ] | ||
branches: [ main ] | ||
types: | ||
- completed # only release when tests have passed | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }} | ||
# only run when tests have passed (or manually triggered) | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
@@ -22,46 +26,31 @@ jobs: | |
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools setuptools_scm wheel | ||
pip install numpy | ||
pip install -e . | ||
pip install -e .[tests] | ||
- name: Test | ||
run: | | ||
for test in tests/test_*py | ||
do if [[ "$test" != *"test_local"* ]] | ||
then pytest $test | ||
fi | ||
done # Ignore local tests file, which tests INCAR and POTCAR file writing but not possible on GitHub Actions | ||
pytest --mpl tests/test_shakenbreak.py # test output plots | ||
pytest --mpl tests/test_plotting.py # test output plots | ||
- name: Build packages | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Generate release tag | ||
uses: amitsingh-007/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TWINE_PASSWORD }} | ||
|
||
- name: Write release info | ||
- name: Generate release info | ||
run: | | ||
awk 'BEGIN {p = 0} {a = 0 }; /^v\d*.\d*.\d*./ { p += 1; a = 1}; p + a == 1 { print } ' CHANGELOG.rst | sed -e '1,1d' | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' > release_info.txt | ||
echo "version=$(grep version setup.py | awk -F\" '{print $2}')" >> $GITHUB_ENV | ||
- name: Release | ||
uses: actions/create-release@v1 | ||
id: create_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.release_tag }} | ||
release_name: ${{ env.release_tag }} | ||
tag_name: v${{ env.version }} | ||
release_name: ${{ env.version }} | ||
body_path: release_info.txt | ||
draft: false | ||
prerelease: false |
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,65 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 5 | ||
|
||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
|
||
name: Python ${{ matrix.python-version }} Test Pop | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[tests] | ||
- name: Check package versions | ||
run: | | ||
pip show -V pymatgen-analysis-defects | ||
pip show -V pymatgen | ||
pip show -V pytest | ||
- name: Test | ||
run: | | ||
pytest --mpl -vv tests # test everything | ||
- name: Generate GH Actions test plots | ||
if: always() # always generate the plots, even if the tests fail | ||
run: | | ||
# Generate the test plots in case there were any failures: | ||
pytest --mpl-generate-path=tests/remote_baseline tests/test_plotting.py | ||
pytest --mpl-generate-path=tests/remote_baseline tests/test_shakenbreak.py | ||
# Upload test plots | ||
- name: Archive test plots | ||
if: always() # always upload the plots, even if the tests fail | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: output-plots | ||
path: tests/remote_baseline | ||
|
||
# - name: Download a single artifact | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: output-plots |
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.