Add test-image action

This commit is contained in:
Ayaz Salikhov
2022-05-12 15:38:14 +03:00
parent e68eaea4c3
commit dfbe591fbd
2 changed files with 28 additions and 11 deletions

22
.github/actions/test-image/action.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: "Pull and test image"
description: "Download image from GitHub artifacts and test it"
inputs:
imageName:
description: "Image name to be tested"
required: true
runs:
using: "composite"
steps:
- name: Download built image 📥
uses: actions/download-artifact@v3
with:
name: ${{ inputs.imageName }}
path: /tmp/
- name: Load downloaded image to docker 📥
run: |
docker load --input /tmp/${{ inputs.imageName }}.tar
docker image ls -a
- name: Run tests ✅
run: python3 -m tests.run_tests --short-image-name ${{ inputs.imageName }}

View File

@@ -57,7 +57,8 @@ jobs:
uses: actions/checkout@v3
- name: Create dev environment 📦
uses: ./.github/actions/create-dev-env
- name: Build image 🛠
- name: Build and push image as GitHub artifact 🛠
uses: ./.github/actions/build-push-image
with:
imageName: base-notebook
@@ -71,14 +72,8 @@ jobs:
uses: actions/checkout@v3
- name: Create dev environment 📦
uses: ./.github/actions/create-dev-env
- name: Download built image 📥
uses: actions/download-artifact@v3
- name: Pull image from GitHub artifacts and test it 🛠
uses: ./.github/actions/test-image
with:
name: base-notebook
path: /tmp/
- name: Load downloaded image to docker 📥
run: |
docker load --input /tmp/base-notebook.tar
docker image ls -a
- name: Run tests ✅
run: python3 -m tests.run_tests --short-image-name base-notebook
imageName: base-notebook