chore: Add docker image tests - container-structure-test-config and dive-ci (#365)

This commit is contained in:
Maksym Vlasov 2022-04-16 19:06:58 +03:00 committed by GitHub
commit 4874cfe42e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 95 additions and 6 deletions

View file

@ -2,10 +2,12 @@ name: "Build Dockerfile if changed and run smoke tests"
on: [pull_request]
env:
IMAGE_TAG: pr-test
jobs:
build:
runs-on: ubuntu-latest
name: Test changed-files
steps:
- uses: actions/checkout@v2
with:
@ -28,4 +30,19 @@ jobs:
platforms: linux/amd64
push: false
tags: |
ghcr.io/${{ github.repository }}:pr-test
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
- name: Run structure tests
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: plexsystems/container-structure-test-action@v0.1.0
with:
image: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
config: .github/.container-structure-test-config.yaml
- name: Dive - check image for waste files
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: MaxymVlasov/dive-action@v0.1.0
with:
image: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
config-file: ${{ github.workspace }}/.github/.dive-ci.yaml
github-token: ${{ secrets.GITHUB_TOKEN }}