[FIX] Fix up actions a bit

This commit is contained in:
lda 2023-11-02 20:10:00 +01:00
parent e75d5b7179
commit dac319ab19
Signed by: lda
GPG key ID: 6898757653ABE3E6
2 changed files with 7 additions and 10 deletions

View file

@ -24,4 +24,4 @@ runs:
shell: bash shell: bash
run: | run: |
echo We are on "${{runner.os}}", requested "${{inputs.compiler}}" as CC echo We are on "${{runner.os}}", requested "${{inputs.compiler}}" as CC
setup "${{ runner.os }}" "${{inputs.compiler}}" "${{inputs.ssl}}" ${GITHUB_ACTION_PATH}/setup "${{ runner.os }}" "${{inputs.compiler}}" "${{inputs.ssl}}"

15
setup
View file

@ -10,11 +10,10 @@ DISTRO=$(grep -E '^NAME=' /etc/os-release |
# Installs a package using the native OS's package manager. # Installs a package using the native OS's package manager.
install_pkg() { install_pkg() {
case $DISTRO in case $DISTRO in
"Ubuntu") "Ubuntu"|"Debian GNU/Linux")
"Debian GNU/Linux" )
apt install -y $1 apt install -y $1
;; ;;
"Arch Linux" ) "Arch Linux")
pacman -Syu --noconfirm $1 pacman -Syu --noconfirm $1
;; ;;
esac esac
@ -23,15 +22,14 @@ install_pkg() {
install_compiler() { install_compiler() {
echo '::group::Setting up a compiler' echo '::group::Setting up a compiler'
case $DISTRO in case $DISTRO in
"Ubuntu" ) "Ubuntu"|"Debian GNU/Linux")
"Debian GNU/Linux" )
install_pkg build-essential install_pkg build-essential
[ $COMPILER = 'clang' ] && install_pkg clang [ $COMPILER = 'clang' ] && install_pkg clang
CC=gcc CC=gcc
[ $COMPILER = 'clang' ] && CC=clang [ $COMPILER = 'clang' ] && CC=clang
;; ;;
"Arch Linux" ) "Arch Linux")
install_pkg $COMPILER make install_pkg $COMPILER make
CC=gcc CC=gcc
[ $COMPILER = 'clang' ] && CC=clang [ $COMPILER = 'clang' ] && CC=clang
@ -41,13 +39,12 @@ install_compiler() {
install_ssl() { install_ssl() {
echo '::group::Setting up SSL' echo '::group::Setting up SSL'
case $DISTRO in case $DISTRO in
"Ubuntu" ) "Ubuntu"|"Debian GNU/Linux")
"Debian GNU/Linux" )
# Doesn't seem like Debian got LibreSSL # Doesn't seem like Debian got LibreSSL
[ $SSL = 'libressl' ] && echo "::error ::LibreSSL is not on Debian" [ $SSL = 'libressl' ] && echo "::error ::LibreSSL is not on Debian"
install_pkg openssl install_pkg openssl
;; ;;
"Arch Linux" ) "Arch Linux")
install_pkg $SSL install_pkg $SSL
esac esac
echo '::endgroup::' echo '::endgroup::'