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

Use of Github Actions to Test Matrix Builds #169

Open
tecio-first opened this issue Feb 24, 2024 · 0 comments
Open

Use of Github Actions to Test Matrix Builds #169

tecio-first opened this issue Feb 24, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@tecio-first
Copy link

tecio-first commented Feb 24, 2024

Is your feature request related to a problem? Please describe.
#165 has shown that sometimes a OS Version is not working

Describe the solution you'd like
Something i have developed for you ;-) ---> Matrix Build for Alpine with Github Actions
You don`t waste time on your side to check against each Version localy

What it does:

  1. Installation Testing for Version 3.17/18/19 (example)
  2. Verbose Loging
  3. some adaption to run NginxProxyManager directly in Github Actions

Action View:
image

Matrix View:
image

Result View:
image
image

Additional context
You can find this here:
https://github.com/tecio-first/proxmox-scripts/tree/main/.github/workflows

name: Nginx Proxy Manager
run-name: Alpine Linux Matrix Build 🚀
on:
  workflow_dispatch:
  push:
    branches: [ '*' ]
    tags-ignore: [ '*' ]
jobs:
  ProxyManagerOnAlpine:
    runs-on: ubuntu-latest
    continue-on-error: true
    strategy:
      matrix:
        alpine: [v3.17, v3.18, v3.19]
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4
        with:
          path: main

      - name: Setup Alpine Linux
        uses: jirutka/setup-alpine@v1
        with:
          mirror-url: http://dl-cdn.alpinelinux.org/alpine
          branch: ${{ matrix.alpine }}
          packages: bash openrc

      - name: Run script inside Alpine chroot as root
        run: |

          # Service related stuff for openrc
          mkdir -p /run/openrc/exclusive
          touch /run/openrc/softlevel
          echo 'rc_provide="dev net"' >> /etc/rc.conf
          # Set Variables
          export EPS_BASE_URL=$GITHUB_WORKSPACE/main
          export EPS_CT_INSTALL=false
          export EPS_CLEANUP=${EPS_CLEANUP:-false}
          EPS_APP_NAME=${EPS_APP_NAME:-nginx-proxy-manager}
          export EPS_APP_CONFIG=${EPS_APP_CONFIG:-$(cat $EPS_BASE_URL/apps/$EPS_APP_NAME/config.sh)}
          export EPS_OS_NAME=$(uname)
          export EPS_OS_DISTRO=$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)
          # Maniuplate the common.sh file for stty/pushd/disown/popd command 
          # and activvate verbose mode and deactivate spinner
          sed -i 's/__OUTPUT=\/dev\/null/__OUTPUT=\/dev\/stdout/' $EPS_BASE_URL/utils/common.sh
          sed -i 's/__start_spinner &/#__start_spinner &/' $EPS_BASE_URL/utils/common.sh
          sed -i 's/__SPIN_PID=$!/#__SPIN_PID=$!/' $EPS_BASE_URL/utils/common.sh
          sed -i 's/stty/#stty/' $EPS_BASE_URL/utils/common.sh
          sed -i 's/pushd/cd/' $EPS_BASE_URL/utils/common.sh
          sed -i 's/disown/#disown/' $EPS_BASE_URL/utils/common.sh
          sed -i 's/popd/#popd/' $EPS_BASE_URL/utils/common.sh
          # export and execute the common.sh and alpine.sh and APP install.sh files
          export EPS_UTILS_COMMON=${EPS_UTILS_COMMON:-$(cat $EPS_BASE_URL/utils/common.sh)}
          export EPS_UTILS_DISTRO=${EPS_UTILS_DISTRO:-$(cat $EPS_BASE_URL/utils/alpine.sh)}
          source <(echo -n "$EPS_UTILS_COMMON")
          source <(echo -n "$EPS_UTILS_DISTRO")
          source <(echo -n "$EPS_APP_CONFIG")
          export EPS_APP_INSTALL=${EPS_APP_INSTALL:-$(cat $EPS_BASE_URL/apps/$EPS_APP_NAME/install.sh)}
          source <(echo -n "$EPS_APP_INSTALL")
        shell: alpine.sh --root {0}

I can also create Actions for other Distros if you like ;-)
Happy Action to you !

@tecio-first tecio-first added the enhancement New feature or request label Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants