Skip to content

Fix Rust coldstart rustplus routing #192

Fix Rust coldstart rustplus routing

Fix Rust coldstart rustplus routing #192

Workflow file for this run

name: PR Pipeline
on:
pull_request:
branches: [master]
jobs:
build-deploy:
runs-on: self-hosted
env:
SCROLL_REGISTRY_PR_NAMESPACE: druid-team-experimental
SCROLL_REGISTRY_ENDPOINT: ${{ secrets.SCROLL_REGISTRY_ENDPOINT }}
SCROLL_REGISTRY_API_KEY: ${{ secrets.SCROLL_REGISTRY_API_KEY }}
SCROLL_REGISTRY_API_SECRET: ${{ secrets.SCROLL_REGISTRY_API_SECRET }}
SCROLL_REGISTRY_BUCKET: ${{ secrets.SCROLL_REGISTRY_BUCKET_STAGING }}
DRUID_CLI_VERSION: v0.1.249
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ">=1.19.3"
- run: apt update && apt install -y make
- name: Build scroll tree
env:
SCROLL_REGISTRY_HOST: ${{ secrets.SCROLL_REGISTRY_HOST }}
run: |
if [ "${{ github.event.pull_request.head.repo.full_name }}" = "${{ github.repository }}" ]; then
registry_host="${SCROLL_REGISTRY_HOST#http://}"
registry_host="${registry_host#https://}"
registry_host="${registry_host%%/*}"
export DRUID_COLDSTARTER_IMAGE="${registry_host}/${SCROLL_REGISTRY_PR_NAMESPACE}/druid:stable-pr${{ github.event.pull_request.number }}"
fi
make build-tree
- name: Get registry binary
if: github.event.pull_request.head.repo.full_name == github.repository
uses: robinraju/release-downloader@v1.7
with:
repository: "highcard-dev/druid-cli"
tag: ${{ env.DRUID_CLI_VERSION }}
fileName: "druid"
token: ${{ secrets.GO_REPO_TOKEN }}
- name: Install druid
if: github.event.pull_request.head.repo.full_name == github.repository
run: |
chmod +x druid
mv druid /usr/local/bin/druid
- name: Validate all scrolls
run: ./scripts/validate_all_scrolls.sh
- name: Login to registry
if: github.event.pull_request.head.repo.full_name == github.repository
run: druid login --host ${{ secrets.SCROLL_REGISTRY_HOST }} --user '${{ secrets.SCROLL_REGISTRY_USER }}' --password ${{ secrets.SCROLL_REGISTRY_PASSWORD }}
- name: Check scroll changes
id: scroll-changes
run: |
set -euo pipefail
git fetch origin "${{ github.base_ref }}" --depth=1
if git diff --quiet "origin/${{ github.base_ref }}"..HEAD -- scrolls; then
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "No scroll source changes; skipping preview push."
else
echo "changed=true" >> "$GITHUB_OUTPUT"
roots="$(
git diff --name-only "origin/${{ github.base_ref }}"..HEAD -- scrolls \
| awk -F/ '$1 == "scrolls" && $2 != "" && $3 != "" && $3 != ".build" && $3 != ".sample" { print "./"$1"/"$2"/"$3 }' \
| sort -u \
| tr '\n' ' '
)"
echo "roots=${roots}" >> "$GITHUB_OUTPUT"
if [ -n "$roots" ]; then
echo "Scroll source changed; publishing previews for: ${roots}"
else
echo "Scroll source changed; publishing all previews."
fi
fi
- name: Push experimental PR tags
if: github.event.pull_request.head.repo.full_name == github.repository && steps.scroll-changes.outputs.changed == 'true'
env:
SCROLL_REGISTRY_HOST: ${{ secrets.SCROLL_REGISTRY_HOST }}
SCROLL_PR_ROOTS: ${{ steps.scroll-changes.outputs.roots }}
run: ./scripts/push.sh "${{ github.event.pull_request.number }}"