Integration tests #820
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration tests | |
on: | |
push: | |
branches: | |
- $default-branch | |
- development | |
- master | |
paths-ignore: | |
- varia/** | |
- '**.md' | |
- utils/prepare_rpm.sh | |
- .github/workflows/publish.yml | |
schedule: | |
# We run the integration tests daily. These tests depend on external hosts and certificates | |
# and it's useful to know when something is not working as soon as possible | |
# | |
# * is a special character in YAML so you have to quote this string | |
- cron: '42 7 * * *' | |
# Run tests for any PRs | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
############################################################################## | |
# macOS | |
macos: | |
name: Running integration tests on ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macos-12 | |
- macos-13 | |
- macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Install shellcheck | |
run: brew install shellcheck shunit2 bash-completion nmap | |
- name: install cpanm and Date::Parse | |
uses: perl-actions/install-with-cpanm@stable | |
with: | |
install: Date::Parse | |
- name: Run the integration tests | |
run: | | |
uname -a \ | |
&& make integration_tests \ | |
&& bash -c "source ./check_ssl_cert.completion && complete -p check_ssl_cert" \ | |
&& make dist \ | |
&& sudo make install_bash_completion && bash -c "source ./check_ssl_cert.completion && complete -p check_ssl_cert" \ | |
&& if command -v shellcheck > /dev/null 2>&1 ; then shellcheck ./check_ssl_cert test/*.sh ; fi | |
############################################################################## | |
# Linuxes | |
linux: | |
# The host should always be linux | |
runs-on: ubuntu-latest | |
name: Running integration tests on ${{ matrix.distro }} | |
strategy: | |
fail-fast: false | |
matrix: | |
distro: | |
- 'debian:10' | |
- 'debian:11' | |
- 'debian:12' | |
- 'debian:testing' | |
- 'ubuntu:18.04' | |
- 'ubuntu:20.04' | |
- 'ubuntu:22.04' | |
- 'alpine:3.13' | |
- 'fedora:39' | |
- 'fedora:40' | |
- 'fedora:41' | |
include: | |
- distro: 'debian:testing' | |
pre: >- | |
apt-get update && | |
DEBIAN_FRONTEND=noninteractive apt-get -y install nmap shellcheck curl sudo perl make bzip2 file openssl dnsutils shunit2 man net-tools bc bash-completion default-jre | |
- distro: 'debian:10' | |
pre: >- | |
apt-get update && | |
DEBIAN_FRONTEND=noninteractive apt-get -y install nmap shellcheck curl sudo perl make bzip2 file openssl dnsutils shunit2 man bc bash-completion default-jre | |
- distro: 'debian:11' | |
pre: >- | |
apt-get update && | |
DEBIAN_FRONTEND=noninteractive apt-get -y install nmap shellcheck curl sudo perl make bzip2 file openssl dnsutils shunit2 man bc bash-completion iproute2 default-jre | |
- distro: 'debian:12' | |
pre: >- | |
apt-get update && | |
DEBIAN_FRONTEND=noninteractive apt-get -y install nmap shellcheck curl sudo perl make bzip2 file openssl dnsutils shunit2 man bc bash-completion iproute2 default-jre | |
- distro: 'ubuntu:18.04' | |
pre: >- | |
apt-get update && | |
DEBIAN_FRONTEND=noninteractive apt-get -y install nmap shellcheck curl sudo perl make bzip2 file openssl dnsutils shunit2 man bc net-tools bash-completion default-jre | |
- distro: 'ubuntu:20.04' | |
pre: >- | |
apt-get update && | |
DEBIAN_FRONTEND=noninteractive apt-get -y install nmap shellcheck curl sudo perl make bzip2 file openssl dnsutils shunit2 man bc net-tools bash-completion default-jre | |
- distro: 'ubuntu:22.04' | |
pre: >- | |
apt-get update && | |
DEBIAN_FRONTEND=noninteractive apt-get -y install nmap shellcheck curl sudo perl make bzip2 file openssl dnsutils shunit2 man bc net-tools bash-completion default-jre | |
- distro: 'alpine:3.13' | |
pre: >- | |
apk update && | |
apk upgrade && | |
apk add -U bash && | |
apk add nmap shellcheck curl sudo perl make wget bzip2 file openssl bind-tools git shunit2 mandoc bc bash-completion openjdk11 | |
- distro: 'fedora:39' | |
pre: >- | |
dnf upgrade -y && | |
dnf install -y hostname && | |
dnf install -y nmap ShellCheck curl sudo perl make bzip2 file openssl bind-utils git shunit2 man bc net-tools bash-completion java-latest-openjdk | |
- distro: 'fedora:40' | |
pre: >- | |
dnf upgrade -y && | |
dnf install -y hostname && | |
dnf install -y nmap ShellCheck curl sudo perl make bzip2 file openssl bind-utils git shunit2 man bc net-tools bash-completion java-latest-openjdk | |
- distro: 'fedora:41' | |
pre: >- | |
dnf upgrade -y && | |
dnf install -y hostname && | |
dnf install -y nmap ShellCheck curl sudo perl make bzip2 file openssl bind-utils git shunit2 man bc net-tools bash-completion java-latest-openjdk | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Run the integration tests on ${{ matrix.distro }} | |
env: | |
PRE: ${{ matrix.pre }} | |
run: | | |
echo $PRE > ./prep-cmd.sh | |
docker run --network host -w /check_ssl_cert -v ${PWD}:/check_ssl_cert ${{ matrix.distro }} \ | |
/bin/sh -c 'sh ./prep-cmd.sh \ | |
&& curl -L https://cpanmin.us | sudo perl - --sudo App::cpanminus \ | |
&& cpanm --sudo install Date::Parse \ | |
&& uname -a \ | |
&& make integration_tests \ | |
&& bash -c "source ./check_ssl_cert.completion && complete -p check_ssl_cert" \ | |
&& make dist \ | |
&& sudo make install_bash_completion && bash -c "source ./check_ssl_cert.completion && complete -p check_ssl_cert" \ | |
&& if command -v shellcheck > /dev/null 2>&1 ; then shellcheck ./check_ssl_cert test/*.sh ; fi' |