]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CI: Use `case()` function
authorTim Duesterhus <tim@bastelstu.be>
Mon, 13 Apr 2026 19:23:42 +0000 (21:23 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 14 Apr 2026 09:16:17 +0000 (11:16 +0200)
GitHub Actions introduced a new `case()` function in January that works just
like HAProxy’s `iif()` converter (just with an arbitrary number of
expressions). It is more robust than chaining strings with `&&` and `||`,
because it includes proper type-checking.

see https://github.blog/changelog/2026-01-29-github-actions-smarter-editing-clearer-debugging-and-a-new-case-function/#write-more-expressive-expressions-with-a-case-function

.github/workflows/vtest.yml

index 6113e4a3c4755dc349b73882aeb5926d7845ef92..6b8eb80a995c3b8a95748272be9f27e6d5f2702a 100644 (file)
@@ -76,9 +76,9 @@ jobs:
       run: |
         sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
         sudo apt-get --no-install-recommends -y install \
-          ${{ contains(matrix.FLAGS, 'USE_LUA=1')     && 'liblua5.4-dev'  || '' }} \
-          ${{ contains(matrix.FLAGS, 'USE_PCRE2=1')   && 'libpcre2-dev'   || '' }} \
-          ${{ contains(matrix.ssl,   'BORINGSSL=yes') && 'ninja-build'    || '' }} \
+          ${{ case(contains(matrix.FLAGS, 'USE_LUA=1'), 'liblua5.4-dev', '') }} \
+          ${{ case(contains(matrix.FLAGS, 'USE_PCRE2=1'), 'libpcre2-dev', '') }} \
+          ${{ case(contains(matrix.ssl, 'BORINGSSL=yes'), 'ninja-build', '') }} \
           socat \
           gdb \
           jose