-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the codebase to support `aiida-core` v2.X, mostly via: 1. Adding `core.` prefix to entry points. 2. Removing `dict=`/`list=` keyword arguments in the corresponding constructors. 3. Use new `base` name spacing. Since the CI was failing in many ways, this has been tweaked and fixed as well: 1. Updates to the `pre-commit`, switching to the `black` formatter, using `isort` and updating `pylint`. 2. Adapting the Docker build for running the examples to: * use the `2.3.1` version of the `aiida-core` image. * Update RASPA to v2.0.47 * Include the `run_examples.sh` file, where we select the examples to run for the CI. 3. The CI tests are now split in the actual `pytest` tests, and examples. Running the examples via `pytest` seemed quite broken, and this way we can split the two so we can e.g. only run the examples for release PRs. The repository was also cleaned up of several files that no longer served any purpose.
- Loading branch information
Showing
46 changed files
with
1,431 additions
and
1,382 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,103 @@ | ||
name: Continuous Integration | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
test-plugin: | ||
tests: | ||
name: Test Suite | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[tests] | ||
- name: Run test suite | ||
run: pytest | ||
|
||
examples: | ||
name: Run examples | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
# see https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Build #and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: false | ||
load: true | ||
tags: aiida_raspa_test | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
|
||
# Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
- name: Run tests | ||
run: | | ||
export DOCKERID=`docker run -d aiida_raspa_test` | ||
docker exec --tty $DOCKERID wait-for-services | ||
docker logs $DOCKERID | ||
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'cd /opt/aiida-raspa/ && py.test --cov aiida_raspa --cov-append .' | ||
# see https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables | ||
docker exec --tty --user aiida --env-file <(env | grep GITHUB_) -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} $DOCKERID /bin/bash -l -c 'cd /opt/aiida-raspa/ && coveralls --service=github' | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build #and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: false | ||
load: true | ||
tags: aiida_raspa_test | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Run examples | ||
run: | # Examples stored and copied from .github/workflows/run_examples.sh | ||
export DOCKERID=`docker run -d aiida_raspa_test` | ||
docker exec --tty $DOCKERID wait-for-services | ||
docker logs $DOCKERID | ||
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'cd $HOME; bash run_examples.sh' | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[pre-commit,test,docs] | ||
reentry scan | ||
- name: Run pre-commit | ||
run: | | ||
pre-commit install | ||
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[pre-commit,tests,docs] | ||
- name: Run pre-commit | ||
run: | | ||
pre-commit install | ||
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) | ||
docs: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[docs,test] | ||
reentry scan | ||
- name: Build docs | ||
run: | | ||
cd docs && make | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[docs] | ||
- name: Build docs | ||
run: | | ||
make -C docs html |
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,7 @@ | ||
#!/bin/bash | ||
|
||
verdi run /opt/aiida-raspa/examples/simple_calculations/example_base.py --submit raspa | ||
verdi run /opt/aiida-raspa/examples/simple_calculations/example_base_restart.py --previous_calc 4 --submit raspa | ||
verdi run /opt/aiida-raspa/examples/simple_calculations/example_binary_mixture.py --submit raspa | ||
verdi run /opt/aiida-raspa/examples/simple_calculations/example_block_pockets_2frameworks_2molecules.py --submit raspa | ||
verdi run /opt/aiida-raspa/examples/simple_calculations/example_block_pockets_simple.py --submit raspa |
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 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 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
Oops, something went wrong.