Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build own docker images for integration tests #901

Merged
merged 13 commits into from
Aug 15, 2024
69 changes: 69 additions & 0 deletions .github/workflows/docker-integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Docker images for integration tests

on:
push:
branches:
- master
workflow_dispatch:

env:
PLATFORMS: "linux/amd64"

jobs:
docker:
name: Build and push Docker image
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./integration-tests/Dockerfile_alpine3
image: goss_alpine3
- dockerfile: ./integration-tests/Dockerfile_arch
image: goss_arch
- dockerfile: ./integration-tests/Dockerfile_centos7
image: goss_centos7
- dockerfile: ./integration-tests/Dockerfile_trusty
image: goss_trusty
- dockerfile: ./integration-tests/Dockerfile_wheezy
image: goss_wheezy
permissions:
packages: write
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}

- name: Build and push tag
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:latest
petemounce marked this conversation as resolved.
Show resolved Hide resolved
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}
3 changes: 1 addition & 2 deletions integration-tests/Dockerfile_arch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM base/archlinux
FROM archlinux:base
MAINTAINER @siddharthist

RUN pacman -Sy --noconfirm systemd-sysvcompat
RUN ln -s /does_not_exist /foo && \
chmod 700 ~root
RUN mkfifo /pipe
2 changes: 1 addition & 1 deletion integration-tests/Dockerfile_arch.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7743af2cd089e92858eca1715db25949 Dockerfile_arch
8fc3ce0c000f89ab09488cccb3ba8e66 Dockerfile_arch
4 changes: 3 additions & 1 deletion integration-tests/Dockerfile_wheezy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ MAINTAINER Ahmed
RUN echo 'deb http://archive.debian.org/debian wheezy main' > /etc/apt/sources.list
RUN echo 'deb http://archive.debian.org/debian-security wheezy/updates main' >> /etc/apt/sources.list

RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && apt-get remove -y vim-tiny && apt-get clean
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install --yes --force-yes \
apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && \
apt-get remove -y vim-tiny && apt-get clean

RUN chkconfig apache2 on
RUN chkconfig tinyproxy on
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/Dockerfile_wheezy.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
485a260105b0f1da058fa4af863e2ecc Dockerfile_wheezy
108ad55356203510134e3e76199236e0 Dockerfile_wheezy