Skip to content

Commit

Permalink
Being able to pick LavinMQ version (#4)
Browse files Browse the repository at this point in the history
Useful right now as there is no compatible package for Ubuntu 24.04, but could probably be handy in more situations.

Switched from`apt ...` to `apt-get ...` to avoid the warning `WARNING: apt does not have a stable CLI interface. Use with caution in scripts.`.
  • Loading branch information
dentarg authored Oct 10, 2024
1 parent c777b34 commit ac66f64
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]
version: [ latest ]
include:
- { os: ubuntu-24.04, version: '1.3.1' }

name: ${{ matrix.os }}
name: ${{ matrix.os }} (${{ matrix.version }})
runs-on: ${{ matrix.os }}
continue-on-error: true # prevent the workflow to fail if this job fails
steps:
Expand All @@ -22,9 +25,15 @@ jobs:
- run: sudo apt-get update
shell: bash
continue-on-error: true
- run: sudo apt install lavinmq
- name: "Install LavinMQ (${{ matrix.version }})"
run: |
if test "${{ matrix.version }}" = "latest";
then
sudo apt-get install lavinmq
else
sudo apt-get install "lavinmq=${{ matrix.version }}-1"
fi
shell: bash
continue-on-error: true
- run: sudo ls -al /etc/lavinmq
shell: bash
continue-on-error: true
Expand All @@ -36,4 +45,4 @@ jobs:
continue-on-error: true
- run: sudo systemctl status lavinmq.service
shell: bash
continue-on-error: true
continue-on-error: true
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]
version: [ latest ]
include:
- { os: ubuntu-24.04, version: '1.3.1' }

name: ${{ matrix.os }}
name: ${{ matrix.os }} (${{ matrix.version }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./
with:
version: ${{ matrix.version }}
- run: lavinmq --version
- run: systemctl is-active lavinmq.service
- run: echo $AMQP_URL
15 changes: 13 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
description: "Name of the environment variable with the LavinMQ URL"
required: false
default: "AMQP_URL"
version:
description: "The version of LavinMQ to install"
required: false
default: "latest"
runs:
using: "composite"
steps:
Expand All @@ -20,11 +24,18 @@ runs:
- run: sudo apt-get update
shell: bash

- run: sudo apt install lavinmq
- name: "Install LavinMQ (${{ inputs.version }})"
run: |
if test "${{ inputs.version }}" = "latest";
then
sudo apt-get install lavinmq
else
sudo apt-get install "lavinmq=${{ inputs.version }}-1"
fi
shell: bash

- run: sudo systemctl start lavinmq.service
shell: bash

- run: echo "${{ inputs.env-key }}=amqp://guest:guest@localhost" >> $GITHUB_ENV
shell: bash
shell: bash

0 comments on commit ac66f64

Please sign in to comment.