Skip to content

Commit

Permalink
Allow specifying different AiiDA base image (#213)
Browse files Browse the repository at this point in the history
This allows us to test the plugin against multiple versions of AiiDA.
  • Loading branch information
yakutovicha authored Mar 19, 2024
1 parent 30adaa3 commit 628febb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
name: Continuous Integration

on:
[push, pull_request]
push:
branches:
- main
pull_request:

jobs:

test-plugin:

runs-on: ubuntu-latest
strategy:
matrix:
aiida-version:
- '2.4.3'
- '2.5.1'

timeout-minutes: 30

steps:
Expand Down Expand Up @@ -35,6 +44,8 @@ jobs:
tags: aiida_cp2k_test
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
build-args: |
AIIDA_VERSION=${{ matrix.aiida-version }}
# Temp fix
# https://github.com/docker/build-push-action/issues/252
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# For further information on the license, see the LICENSE.txt file. #
###############################################################################

ARG AIIDA_VERSION=2.5.0

FROM aiidateam/aiida-core-with-services:2.5.0
FROM aiidateam/aiida-core-with-services:${AIIDA_VERSION}

# To prevent the container to exit prematurely.
ENV KILL_ALL_RPOCESSES_TIMEOUT=50
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,15 @@ Once this is done, you can build the Docker image with the following command:
```bash
docker build -t aiida_cp2k_test .
```
To test against another version of aiida-core, you can specify the build agrument `AIIDA_VERSION`:
```bash
docker build -t aiida_cp2k_test --build-arg AIIDA_VERSION=2.4.3 .
```

Then, you can launch the container:

```bash
DOKERID=`docker run -d aiida_cp2k_test`
DOCKERID=`docker run -d aiida_cp2k_test`
```
This will remeber the container ID in the variable `DOKERID`.
You can then run the tests with the following command:
Expand Down

0 comments on commit 628febb

Please sign in to comment.