Skip to content

Sync internal 2026-08-24 #1247

Sync internal 2026-08-24

Sync internal 2026-08-24 #1247

Workflow file for this run

on: [push, pull_request]
name: build
env:
OPENRESTY_VERSION: 1.27.1.2
OPENRESTY_SHA256: 74f076f7e364b2a99a6c5f9bb531c27610c78985abe956b442b192a2295f7548
jobs:
pingora:
strategy:
fail-fast: false
matrix:
# nightly, msrv, and latest stable
toolchain: [nightly, 1.85.0, 1.97.1]
runs-on: ubuntu-24.04
# Only run on "pull_request" event for external PRs. This is to avoid
# duplicate builds for PRs created from internal branches.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y cmake libclang-dev ca-certificates curl --no-install-recommends
- name: Cache OpenResty
if: matrix.toolchain != '1.85.0'
id: cache-openresty
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: ~/.local/openresty
key: openresty-${{ runner.os }}-${{ runner.arch }}-${{ env.OPENRESTY_VERSION }}-${{ env.OPENRESTY_SHA256 }}-v1
- name: Build OpenResty
if: matrix.toolchain != '1.85.0' && steps.cache-openresty.outputs.cache-hit != 'true'
run: |
sudo apt install -y build-essential libpcre2-dev libssl-dev zlib1g-dev --no-install-recommends
archive="$RUNNER_TEMP/openresty-$OPENRESTY_VERSION.tar.gz"
curl --fail --location --proto '=https' --tlsv1.2 \
--retry 5 --retry-all-errors \
"https://github.com/openresty/openresty/releases/download/v$OPENRESTY_VERSION/openresty-$OPENRESTY_VERSION.tar.gz" \
--output "$archive"
printf '%s %s\n' "$OPENRESTY_SHA256" "$archive" | sha256sum --check --strict
tar --extract --gzip --file "$archive" --directory "$RUNNER_TEMP"
cd "$RUNNER_TEMP/openresty-$OPENRESTY_VERSION"
./configure \
--prefix="$HOME/.local/openresty" \
--with-http_ssl_module \
--with-http_v2_module
make -j"$(nproc)"
make install
- name: Add OpenResty to PATH
if: matrix.toolchain != '1.85.0'
run: |
test -x "$HOME/.local/openresty/bin/openresty"
echo "$HOME/.local/openresty/bin" >> "$GITHUB_PATH"
"$HOME/.local/openresty/bin/openresty" -V
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo check
run: |
if [[ ${{ matrix.toolchain }} == 1.85.0 ]]; then
# pingora-foundations follows Foundations' higher MSRV and is covered by the other toolchains in this matrix.
cargo check --workspace --exclude pingora-foundations
else
cargo check --workspace
fi
- name: Run cargo test
if: matrix.toolchain != '1.85.0'
run: cargo test --verbose --lib --bins --tests --no-fail-fast
# Need to run doc tests separately.
# (https://github.com/rust-lang/cargo/issues/6669)
- name: Run cargo doc test
if: matrix.toolchain != '1.85.0'
run: cargo test --verbose --doc
- name: Run cargo clippy
run: |
[[ ${{ matrix.toolchain }} != 1.97.1 ]] || cargo clippy --all-targets --all -- --allow=unknown-lints --deny=warnings
- name: Run cargo audit
run: |
[[ ${{ matrix.toolchain }} != 1.97.1 ]] || (cargo install --locked cargo-audit && cargo generate-lockfile --ignore-rust-version && cargo audit)
- name: Run cargo machete
run: |
[[ ${{ matrix.toolchain }} != 1.97.1 ]] || (cargo install cargo-machete --version 0.7.0 && cargo machete)