name: Vector Integration Check
on:
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
check-vector:
runs-on: ubuntu-latest
steps:
- name: Checkout VRL
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
path: vrl
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
- name: Install protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
build-essential \
cmake \
libclang-dev \
libsasl2-dev \
libssl-dev \
llvm \
pkg-config
- name: Clone Vector repo and update VRL dependency
env:
VRL_GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
VRL_GITHUB_BRANCH: ${{ github.head_ref }}
run: |
git clone https://github.com/vectordotdev/vector.git
cd vector
git switch master
# Set new git repo and branch
NEW_REPO="https://github.com/${VRL_GITHUB_REPO}.git"
NEW_BRANCH="${VRL_GITHUB_BRANCH}"
# Extract existing features (if any)
FEATURES=$(sed -nE 's/.*vrl = \{[^}]*features = (\[[^]]*\]).*/\1/p' Cargo.toml)
# Compose the new dependency line
if [[ -n "$FEATURES" ]]; then
NEW_VRL_DEP_LINE="vrl = { git = \"$NEW_REPO\", branch = \"$NEW_BRANCH\", features = $FEATURES }"
else
NEW_VRL_DEP_LINE="vrl = { git = \"$NEW_REPO\", branch = \"$NEW_BRANCH\" }"
fi
# Replace the old vrl line
sed -i.bak -E "s|vrl = \{[^}]*\}|$NEW_VRL_DEP_LINE|" Cargo.toml
cargo update -p vrl
- name: Cargo Check Vector
run: |
cd vector
cargo update -p vrl
cargo check --workspace