Refactor CI workflows to use specific CentOS images and add alternati… #1
This file contains hidden or 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: Quick Compatibility Test | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| quick-test: | |
| name: Quick Multi-OS Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Use the most reliable and commonly available images | |
| - os: ubuntu:20.04 | |
| name: "Ubuntu 20.04" | |
| install_cmd: "apt-get update -qq && apt-get install -y -qq curl wget socat cron procps" | |
| - os: ubuntu:22.04 | |
| name: "Ubuntu 22.04" | |
| install_cmd: "apt-get update -qq && apt-get install -y -qq curl wget socat cron procps" | |
| - os: debian:11 | |
| name: "Debian 11" | |
| install_cmd: "apt-get update -qq && apt-get install -y -qq curl wget socat cron procps" | |
| - os: debian:12 | |
| name: "Debian 12" | |
| install_cmd: "apt-get update -qq && apt-get install -y -qq curl wget socat cron procps" | |
| - os: almalinux:9 | |
| name: "AlmaLinux 9" | |
| install_cmd: "dnf update -y -q && dnf install -y -q curl wget socat cronie procps-ng" | |
| - os: rockylinux:9 | |
| name: "Rocky Linux 9" | |
| install_cmd: "dnf update -y -q && dnf install -y -q curl wget socat cronie procps-ng" | |
| - os: fedora:39 | |
| name: "Fedora 39" | |
| install_cmd: "dnf update -y -q && dnf install -y -q curl wget socat cronie procps-ng" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Test on ${{ matrix.name }} | |
| run: | | |
| echo "🧪 Testing cert_manager.sh on ${{ matrix.name }}" | |
| docker run --rm -v $PWD:/workspace -w /workspace ${{ matrix.os }} bash -c ' | |
| set -e | |
| echo "📦 Installing dependencies..." | |
| ${{ matrix.install_cmd }} | |
| echo "🔧 Preparing script..." | |
| chmod +x cert_manager.sh | |
| echo "✅ Running syntax check..." | |
| bash -n cert_manager.sh | |
| echo "🚀 Testing basic execution..." | |
| echo "0" | timeout 10s ./cert_manager.sh >/dev/null 2>&1 || true | |
| echo "🔍 Verifying dependencies..." | |
| command -v curl >/dev/null && echo " ✅ curl available" | |
| command -v wget >/dev/null && echo " ✅ wget available" | |
| command -v socat >/dev/null && echo " ✅ socat available" | |
| (command -v cron >/dev/null || command -v cronie >/dev/null) && echo " ✅ cron service available" | |
| echo "🎉 All tests passed on ${{ matrix.name }}!" | |
| ' | |
| test-summary: | |
| name: Test Summary | |
| runs-on: ubuntu-latest | |
| needs: quick-test | |
| if: always() | |
| steps: | |
| - name: Check test results | |
| run: | | |
| if [ "${{ needs.quick-test.result }}" = "success" ]; then | |
| echo "✅ All quick compatibility tests passed!" | |
| echo "The script is compatible with major Linux distributions." | |
| else | |
| echo "⚠️ Some compatibility tests failed." | |
| echo "Check the individual job results for details." | |
| exit 1 | |
| fi |