From 628febbb87a9fda2d1f5f7fd7cbcd4836253a979 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Tue, 19 Mar 2024 16:26:24 +0600 Subject: [PATCH] Allow specifying different AiiDA base image (#213) This allows us to test the plugin against multiple versions of AiiDA. --- .github/workflows/ci.yml | 13 ++++++++++++- Dockerfile | 3 ++- README.md | 7 ++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8586ce..c6af0a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 diff --git a/Dockerfile b/Dockerfile index e245149..9762664 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index 498bf8a..cf6768b 100644 --- a/README.md +++ b/README.md @@ -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: