Skip to content

Commit

Permalink
replace test dockerfile with docker run command in github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia-nikiforov-umn committed Nov 2, 2023
1 parent 89a53ae commit 61bd81a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker publish
name: Docker publish and test

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
Expand All @@ -10,6 +10,7 @@ on:
types: [ published ]
pull_request:
branches: [ main ]
push:

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -185,7 +186,7 @@ jobs:
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
if: (github.event_name != 'pull_request') && (github.event_name != 'push')
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
Expand Down Expand Up @@ -228,7 +229,7 @@ jobs:
with:
context: docker/${{ env.DOCKER_DIR_CONFIG }}
file: docker/${{ env.DOCKER_DIR_CONFIG }}/${{ env.DOCKERFILE_NAME }}
push: ${{ github.event_name != 'pull_request' }}
push: ${{ (github.event_name != 'pull_request') && (github.event_name != 'push') }}
build-args: |
"IMAGE_INSTALL=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_INSTALL }}"
tags: |
Expand All @@ -246,6 +247,10 @@ jobs:
rm -rf ${{ env.IMAGE_CACHE_DIR_SYS }}
rm -rf ${{ env.IMAGE_CACHE_DIR_GIT }}
- name: Test minimal image
run: |
docker run --rm --mount type=bind,src=$PWD/test/test_scripts_and_data,target=/home/openkim/test_scripts_and_data --env LD_LIBRARY_PATH=:/usr/local/lib image_minimal /bin/bash -c 'cd /home/openkim/test_scripts_and_data && bash set_up_and_run_equilibriumcrystalstructure_sample.sh && python compare_dbs.py'
# Finally, install additional packages to create the full image based on
# the minimal image
#
Expand All @@ -255,7 +260,7 @@ jobs:
with:
context: docker/${{ env.DOCKER_DIR_ADDITIONAL }}
file: docker/${{ env.DOCKER_DIR_ADDITIONAL }}/${{ env.DOCKERFILE_NAME }}
push: ${{ github.event_name != 'pull_request' }}
push: ${{ (github.event_name != 'pull_request') && (github.event_name != 'push') }}
build-args: |
"IMAGE_MINIMAL=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}-minimal"
tags: |
Expand Down
10 changes: 0 additions & 10 deletions docker/test/Dockerfile

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ kimitems install -D Sim_LAMMPS_TersoffZBL_DevanathanDiazdelaRubiaWeber_1998_SiC_

pipeline-database set local

pipeline-run-matches \*_TE_\*
pipeline-run-matches \*_TE_\*

0 comments on commit 61bd81a

Please sign in to comment.