mirror of
https://github.com/curl/curl.git
synced 2026-07-25 12:47:21 +03:00
GHA: enclose if expressions in ${{ }} where missing
Enclosing expressions in `${{ }}` is optional, but sometimes required.
It seems more straighforward to use it always rather than decide on
a case-by-case basis. Before this patch 71 `if`s were enclosed and 49
were not. Enclosing these makes it easy to grep and recognize these
whereever used.
https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/using-conditions-to-control-job-execution
Closes #17550
This commit is contained in:
parent
5f805eec11
commit
128c5ddc6b
5 changed files with 54 additions and 55 deletions
58
.github/workflows/linux.yml
vendored
58
.github/workflows/linux.yml
vendored
|
|
@ -305,7 +305,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: 'install prereqs'
|
||||
if: matrix.build.container == null && !contains(matrix.build.name, 'i686')
|
||||
if: ${{ matrix.build.container == null && !contains(matrix.build.name, 'i686') }}
|
||||
env:
|
||||
INSTALL_PACKAGES: >-
|
||||
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') && 'stunnel4' || '' }}
|
||||
|
|
@ -323,7 +323,7 @@ jobs:
|
|||
python3 -m venv ~/venv
|
||||
|
||||
- name: 'install prereqs'
|
||||
if: contains(matrix.build.name, 'i686')
|
||||
if: ${{ contains(matrix.build.name, 'i686') }}
|
||||
run: |
|
||||
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
|
||||
sudo dpkg --add-architecture i386
|
||||
|
|
@ -336,7 +336,7 @@ jobs:
|
|||
python3 -m venv ~/venv
|
||||
|
||||
- name: 'install dependencies'
|
||||
if: startsWith(matrix.build.container, 'alpine')
|
||||
if: ${{ startsWith(matrix.build.container, 'alpine') }}
|
||||
run: |
|
||||
apk add --no-cache build-base autoconf automake libtool perl openssl-dev \
|
||||
libssh2-dev zlib-dev brotli-dev zstd-dev libidn2-dev openldap-dev \
|
||||
|
|
@ -345,7 +345,7 @@ jobs:
|
|||
perl-time-hires openssh stunnel sudo git openssl
|
||||
|
||||
- name: 'cache bearssl'
|
||||
if: contains(matrix.build.install_steps, 'bearssl')
|
||||
if: ${{ contains(matrix.build.install_steps, 'bearssl') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-bearssl
|
||||
env:
|
||||
|
|
@ -355,7 +355,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.BEARSSL_VERSION }}
|
||||
|
||||
- name: 'build bearssl'
|
||||
if: contains(matrix.build.install_steps, 'bearssl') && steps.cache-bearssl.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'bearssl') && steps.cache-bearssl.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
|
||||
"https://bearssl.org/bearssl-${BEARSSL_VERSION}.tar.gz" | tar -xz
|
||||
|
|
@ -366,7 +366,7 @@ jobs:
|
|||
cp build/libbearssl.* ~/bearssl/lib
|
||||
|
||||
- name: 'cache libressl'
|
||||
if: contains(matrix.build.install_steps, 'libressl')
|
||||
if: ${{ contains(matrix.build.install_steps, 'libressl') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-libressl
|
||||
env:
|
||||
|
|
@ -376,7 +376,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}
|
||||
|
||||
- name: 'build libressl'
|
||||
if: contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
|
||||
"https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" | tar -xz
|
||||
|
|
@ -385,7 +385,7 @@ jobs:
|
|||
make install
|
||||
|
||||
- name: 'cache wolfssl (all)'
|
||||
if: contains(matrix.build.install_steps, 'wolfssl-all')
|
||||
if: ${{ contains(matrix.build.install_steps, 'wolfssl-all') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-wolfssl-all
|
||||
env:
|
||||
|
|
@ -395,7 +395,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }}
|
||||
|
||||
- name: 'build wolfssl (all)' # does not support `OPENSSL_COEXIST`
|
||||
if: contains(matrix.build.install_steps, 'wolfssl-all') && steps.cache-wolfssl-all.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'wolfssl-all') && steps.cache-wolfssl-all.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
|
||||
"https://github.com/wolfSSL/wolfssl/archive/v${WOLFSSL_VERSION}-stable.tar.gz" | tar -xz
|
||||
|
|
@ -406,7 +406,7 @@ jobs:
|
|||
make install
|
||||
|
||||
- name: 'cache wolfssl (opensslextra)' # does support `OPENSSL_COEXIST`
|
||||
if: contains(matrix.build.install_steps, 'wolfssl-opensslextra')
|
||||
if: ${{ contains(matrix.build.install_steps, 'wolfssl-opensslextra') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-wolfssl-opensslextra
|
||||
env:
|
||||
|
|
@ -416,7 +416,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }}
|
||||
|
||||
- name: 'build wolfssl (opensslextra)'
|
||||
if: contains(matrix.build.install_steps, 'wolfssl-opensslextra') && steps.cache-wolfssl-opensslextra.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'wolfssl-opensslextra') && steps.cache-wolfssl-opensslextra.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
|
||||
"https://github.com/wolfSSL/wolfssl/archive/v${WOLFSSL_VERSION}-stable.tar.gz" | tar -xz
|
||||
|
|
@ -427,7 +427,7 @@ jobs:
|
|||
make install
|
||||
|
||||
- name: 'cache wolfssh'
|
||||
if: contains(matrix.build.install_steps, 'wolfssh')
|
||||
if: ${{ contains(matrix.build.install_steps, 'wolfssh') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-wolfssh
|
||||
env:
|
||||
|
|
@ -437,7 +437,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.WOLFSSH_VERSION }}-${{ env.WOLFSSL_VERSION }}
|
||||
|
||||
- name: 'build wolfssh'
|
||||
if: contains(matrix.build.install_steps, 'wolfssh') && steps.cache-wolfssh.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'wolfssh') && steps.cache-wolfssh.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
|
||||
"https://github.com/wolfSSL/wolfssh/archive/v${WOLFSSH_VERSION}-stable.tar.gz" | tar -xz
|
||||
|
|
@ -448,7 +448,7 @@ jobs:
|
|||
make install
|
||||
|
||||
- name: 'cache mbedtls'
|
||||
if: contains(matrix.build.install_steps, 'mbedtls')
|
||||
if: ${{ contains(matrix.build.install_steps, 'mbedtls') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-mbedtls
|
||||
env:
|
||||
|
|
@ -458,7 +458,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.MBEDTLS_VERSION }}
|
||||
|
||||
- name: 'build mbedtls'
|
||||
if: contains(matrix.build.install_steps, 'mbedtls') && steps.cache-mbedtls.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'mbedtls') && steps.cache-mbedtls.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
|
||||
"https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-${MBEDTLS_VERSION}/mbedtls-${MBEDTLS_VERSION}.tar.bz2" | tar -xj
|
||||
|
|
@ -471,7 +471,7 @@ jobs:
|
|||
cmake --install .
|
||||
|
||||
- name: 'cache openssl (thread sanitizer)'
|
||||
if: contains(matrix.build.install_steps, 'openssl-tsan')
|
||||
if: ${{ contains(matrix.build.install_steps, 'openssl-tsan') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-openssl-tsan
|
||||
env:
|
||||
|
|
@ -481,7 +481,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.OPENSSL_VERSION }}
|
||||
|
||||
- name: 'build openssl (thread sanitizer)'
|
||||
if: contains(matrix.build.install_steps, 'openssl-tsan') && steps.cache-openssl-tsan.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'openssl-tsan') && steps.cache-openssl-tsan.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
git clone --quiet --depth=1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
|
||||
cd openssl
|
||||
|
|
@ -490,7 +490,7 @@ jobs:
|
|||
make -j1 install_sw
|
||||
|
||||
- name: 'cache quictls'
|
||||
if: contains(matrix.build.install_steps, 'quictls')
|
||||
if: ${{ contains(matrix.build.install_steps, 'quictls') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-quictls
|
||||
env:
|
||||
|
|
@ -500,7 +500,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.QUICTLS_VERSION }}-quic1
|
||||
|
||||
- name: 'build quictls'
|
||||
if: contains(matrix.build.install_steps, 'quictls') && steps.cache-quictls.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'quictls') && steps.cache-quictls.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
git clone --quiet --depth=1 -b "openssl-${QUICTLS_VERSION}-quic1" https://github.com/quictls/openssl
|
||||
cd openssl
|
||||
|
|
@ -509,7 +509,7 @@ jobs:
|
|||
make -j1 install_sw
|
||||
|
||||
- name: 'cache msh3'
|
||||
if: contains(matrix.build.install_steps, 'msh3')
|
||||
if: ${{ contains(matrix.build.install_steps, 'msh3') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-msh3
|
||||
env:
|
||||
|
|
@ -519,7 +519,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.MSH3_VERSION }}
|
||||
|
||||
- name: 'build msh3'
|
||||
if: contains(matrix.build.install_steps, 'msh3') && steps.cache-msh3.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'msh3') && steps.cache-msh3.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
git clone --quiet --depth=1 -b "v${MSH3_VERSION}" --recursive https://github.com/nibanks/msh3
|
||||
cd msh3
|
||||
|
|
@ -528,7 +528,7 @@ jobs:
|
|||
cmake --install .
|
||||
|
||||
- name: 'cache awslc'
|
||||
if: contains(matrix.build.install_steps, 'awslc')
|
||||
if: ${{ contains(matrix.build.install_steps, 'awslc') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-awslc
|
||||
env:
|
||||
|
|
@ -538,7 +538,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.AWSLC_VERSION }}
|
||||
|
||||
- name: 'build awslc'
|
||||
if: contains(matrix.build.install_steps, 'awslc') && steps.cache-awslc.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'awslc') && steps.cache-awslc.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
|
||||
"https://github.com/awslabs/aws-lc/archive/refs/tags/v${AWSLC_VERSION}.tar.gz" | tar -xz
|
||||
|
|
@ -549,7 +549,7 @@ jobs:
|
|||
cmake --install .
|
||||
|
||||
- name: 'cache rustls'
|
||||
if: contains(matrix.build.install_steps, 'rustls')
|
||||
if: ${{ contains(matrix.build.install_steps, 'rustls') }}
|
||||
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||
id: cache-rustls
|
||||
env:
|
||||
|
|
@ -559,7 +559,7 @@ jobs:
|
|||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.RUSTLS_VERSION }}
|
||||
|
||||
- name: 'fetch rustls deb'
|
||||
if: contains(matrix.build.install_steps, 'rustls') && steps.cache-rustls.outputs.cache-hit != 'true'
|
||||
if: ${{ contains(matrix.build.install_steps, 'rustls') && steps.cache-rustls.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
mkdir -p ~/rustls
|
||||
curl -LsSf --retry 6 --retry-connrefused --max-time 999 \
|
||||
|
|
@ -569,11 +569,11 @@ jobs:
|
|||
|
||||
- name: 'build rustls'
|
||||
# Note: we don't check cache-hit here. If the cache is hit, we still need to dpkg install the deb.
|
||||
if: contains(matrix.build.install_steps, 'rustls')
|
||||
if: ${{ contains(matrix.build.install_steps, 'rustls') }}
|
||||
run: sudo dpkg -i ~/rustls/"librustls_${RUSTLS_VERSION}_amd64.deb"
|
||||
|
||||
- name: 'install Intel compilers'
|
||||
if: contains(matrix.build.install_steps, 'intel')
|
||||
if: ${{ contains(matrix.build.install_steps, 'intel') }}
|
||||
run: |
|
||||
curl -sSf --compressed https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo tee /etc/apt/trusted.gpg.d/intel-sw.asc >/dev/null
|
||||
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
|
||||
|
|
@ -698,13 +698,13 @@ jobs:
|
|||
fi
|
||||
|
||||
- name: 'install pytest prereqs'
|
||||
if: contains(matrix.build.install_steps, 'pytest')
|
||||
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
|
||||
run: |
|
||||
[ -x ~/venv/bin/activate ] && source ~/venv/bin/activate
|
||||
python3 -m pip install -r tests/http/requirements.txt
|
||||
|
||||
- name: 'run pytest'
|
||||
if: contains(matrix.build.install_steps, 'pytest')
|
||||
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
|
||||
env:
|
||||
PYTEST_ADDOPTS: '--color=yes'
|
||||
PYTEST_XDIST_AUTO_NUM_WORKERS: 4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue