From e92840db0aca567c20752a296614ef4fe90b8a64 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Thu, 5 Sep 2024 13:01:15 +0200 Subject: [PATCH] ci: Run installation check for all provied versions of codemeter-lite --- .github/workflows/ci.yml | 4 +-- .../ci_ubuntu_dispatch_installation.yml | 33 +++++++++++++++++++ .../ci_ubuntu_verify_installation.yml | 10 ++++-- 3 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci_ubuntu_dispatch_installation.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8182283..964bf52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,5 +7,5 @@ name: CI jobs: ubuntu_verify_repo: uses: ./.github/workflows/ci_ubuntu_verify_repo.yml - ubuntu_verify_installation: - uses: ./.github/workflows/ci_ubuntu_verify_installation.yml + ubuntu_dispatch_installation: + uses: ./.github/workflows/ci_ubuntu_dispatch_installation.yml diff --git a/.github/workflows/ci_ubuntu_dispatch_installation.yml b/.github/workflows/ci_ubuntu_dispatch_installation.yml new file mode 100644 index 0000000..2f1ddcc --- /dev/null +++ b/.github/workflows/ci_ubuntu_dispatch_installation.yml @@ -0,0 +1,33 @@ +name: CI ubuntu dispatch installation +'on': + workflow_call: null +jobs: + dispatch_installations: + runs-on: ubuntu-latest + steps: + - name: Checkout (GitHub) + uses: actions/checkout@v4 + - name: Provide the repo locally via http + run: nohup python3 -m http.server 8080 & + working-directory: ./ubuntu/ + - name: Install maintainer publickey + run: curl -s --compressed http://localhost:8080/burfeind_jan-niklas.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/burfeind_jan-niklas.gpg + - name: Add local repo to APT sources + run: echo "deb [signed-by=/etc/apt/trusted.gpg.d/burfeind_jan-niklas.gpg] http://localhost:8080 ./" | sudo tee /etc/apt/sources.list.d/localrepo.list + - name: update apt + run: sudo apt-get update + - name: Get available versions of c-lite + id: get_versions + run: | + apt-cache madison codemeter-lite | grep "http://localhost:8080" | awk '{print $3}' > versions.txt + cat versions.txt + - name: Trigger downstream jobs for each version + run: | + while read version; do + echo "Triggering installation for version $version" + gh workflow run ci_ubuntu_verify_installation.yml -f "package_version=$version" --ref ${{ github.ref_name }} + done < versions.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Kill the webserver again + run: sudo pkill python3 diff --git a/.github/workflows/ci_ubuntu_verify_installation.yml b/.github/workflows/ci_ubuntu_verify_installation.yml index 98c8d4d..135f8ec 100644 --- a/.github/workflows/ci_ubuntu_verify_installation.yml +++ b/.github/workflows/ci_ubuntu_verify_installation.yml @@ -1,6 +1,10 @@ name: CI ubuntu verify installation 'on': - workflow_call: null + workflow_dispatch: + inputs: + package_version: + description: 'Version of codemeter-lite to install' + required: true jobs: package_is_installable: runs-on: ubuntu-latest @@ -16,8 +20,8 @@ jobs: run: echo "deb [signed-by=/etc/apt/trusted.gpg.d/burfeind_jan-niklas.gpg] http://localhost:8080 ./" | sudo tee /etc/apt/sources.list.d/localrepo.list - name: Update apt run: sudo apt-get update - - name: Install codemeter-lite - run: sudo apt-get install -y codemeter-lite + - name: Install codemeter-lite in version ${{ github.event.inputs.package_version }} + run: sudo apt-get install -y codemeter-lite=${{ github.event.inputs.package_version }} - name: Kill the webserver again run: sudo pkill python3 - name: Codemeter is running