Skip to content

Docker Test Workflow #86

Docker Test Workflow

Docker Test Workflow #86

Workflow file for this run

---
#
# https://docs.docker.com/build/ci/github-actions/
# https://github.com/docker/build-push-action
# https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
#
name: Docker Test Workflow
on: # yamllint disable-line rule:truthy
workflow_dispatch:
workflow_run:
workflows:
- "Docker Build Workflow"
types:
- completed
env:
IMAGE_NAME: ci-generic-debian
defaults:
run:
shell: bash
jobs:
stage1:
name: Docker Container Test
env:
ORG: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_NAME: ci-generic-debian
runs-on: ubuntu-latest
steps:
- name: Test Entrypoint Default
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "Testing default entrypoint\n"
docker run "${ORG_IMAGE}:latest"
} | tee -a "${GITHUB_STEP_SUMMARY}"
- name: Test Entrypoint - Rust
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "Testing entrypoint - rust\n"
docker run "${ORG_IMAGE}:latest" rustc --version
} | tee -a "${GITHUB_STEP_SUMMARY}"
- name: Test Entrypoint - Go
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "Testing entrypoint - go\n"
docker run "${ORG_IMAGE}:latest" go version
} | tee -a "${GITHUB_STEP_SUMMARY}"
- name: Test Entrypoint - NodeJs
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "Testing entrypoint - nodejs\n"
docker run "${ORG_IMAGE}:latest" node --version
} | tee -a "${GITHUB_STEP_SUMMARY}"
- name: Test Entrypoint - Ruby
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "Testing entrypoint - ruby\n"
docker run "${ORG_IMAGE}:latest" ruby --version
} | tee -a "${GITHUB_STEP_SUMMARY}"
- name: Test Entrypoint - Gcc
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "Testing entrypoint - gcc\n"
docker run "${ORG_IMAGE}:latest" gcc --version
} | tee -a "${GITHUB_STEP_SUMMARY}"
- name: Test Entrypoint - Python
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "Testing entrypoint - python\n"
docker run "${ORG_IMAGE}:latest" python --version
} | tee -a "${GITHUB_STEP_SUMMARY}"
- name: Docker Version
run: |-
docker version
- name: Test Entrypoint - Docker
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "Testing entrypoint - docker\n"
docker run -v /var/run/docker.sock:/var/run/docker.sock "${ORG_IMAGE}:latest" docker version
} | tee -a "${GITHUB_STEP_SUMMARY}"
stage2:
name: Dagger Test
env:
ORG: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_NAME: ci-generic-debian
runs-on: ubuntu-latest
steps:
- name: Show dagger version
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "dagger version\n"
docker run "${ORG_IMAGE}:latest" dagger version
} |& tee -a "${GITHUB_STEP_SUMMARY}"
- name: Test dagger run
run: |-
{
ORG_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}"
printf "Testing entrypoint - dagger\n"
docker run -v /var/run/docker.sock:/var/run/docker.sock "${ORG_IMAGE}:latest" dagger run uptime
} |& tee -a "${GITHUB_STEP_SUMMARY}"
stage3:
name: Dagger Script Test
runs-on: ubuntu-latest
container:
image: vpayno/ci-generic-debian:latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Test dagger shell cli
run: |-
{
printf "Testing dagger script\n"
.github/dagger/dagger-cli-test-ci-container.sh
} |& tee -a "${GITHUB_STEP_SUMMARY}"