Skip to content

Commit

Permalink
Ubuntu 24.04 in GitHub actions doesn't contain apt-fast, stop using it (
Browse files Browse the repository at this point in the history
#412)

Actions are crashing because of it, used in XML linter action to install `xmllint` which is used to validate `phpcs.xml`.

Introduced in #122.
  • Loading branch information
spaze authored Oct 15, 2024
2 parents 6ff90f2 + 9bac12d commit 165ef3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lint-xml:
bin/xmllint.sh

lint-xml-auto-install:
bin/xmllint.sh --auto-install-with-apt-fast
bin/xmllint.sh --auto-install-with-apt

phpcs:
vendor/bin/phpcs src/ public/ tests/
Expand Down
8 changes: 4 additions & 4 deletions app/bin/xmllint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash

OPT_AUTO_INSTALL_WITH_APT_FAST="--auto-install-with-apt-fast"
OPT_AUTO_INSTALL_WITH_APT="--auto-install-with-apt"

function install() {
apt-fast --yes --no-install-recommends install libxml2-utils
sudo apt --yes --no-install-recommends install libxml2-utils
}


if ! hash xmllint 2>/dev/null; then
if [ $# -eq 0 ]; then
echo "xmllint is required but it's not installed, install it with e.g. apt install libxml2-utils, or run $0 $OPT_AUTO_INSTALL_WITH_APT_FAST"
echo "xmllint is required but it's not installed, install it with e.g. apt install libxml2-utils, or run $0 $OPT_AUTO_INSTALL_WITH_APT"
exit 1
else
if [ "$1" = "$OPT_AUTO_INSTALL_WITH_APT_FAST" ]; then
if [ "$1" = "$OPT_AUTO_INSTALL_WITH_APT" ]; then
echo "xmllint is required, will be installed automatically"
install
if ! install; then
Expand Down

0 comments on commit 165ef3a

Please sign in to comment.