Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 64 additions & 7 deletions .github/workflows/cmake_heavy_test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
name: macOS/Windows/Linux Heavy Test

on:
schedule:
- cron: "23 2 * * 0" # Sundays, 02:23 UTC, every product (see the products job)
workflow_dispatch:
inputs:
product:
description: Product to test (directory name under products/)
required: true
default: eq

# When pushing new commits, cancel any running builds on that branch
# When pushing new commits, cancel any running builds on that branch (of this workflow: the scheduled run on main must
# not cancel, or be cancelled by, another workflow's run there)
concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
Expand All @@ -29,12 +32,66 @@ env:
CMAKE_CXX_COMPILER_LAUNCHER: sccache

jobs:
products:
# what to test: the product asked for or, on the schedule, every product; minus the runners a product can't build
# on (products/<product>/PLATFORMS, read as the top-level CMakeLists.txt does)
name: Products
runs-on: ubuntu-latest
outputs:
products: ${{ steps.list.outputs.products }}
names: ${{ steps.list.outputs.names }}
exclude: ${{ steps.list.outputs.exclude }}
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: List products and runners
id: list
shell: bash
env:
PRODUCT: ${{ inputs.product }}
# each build_and_test entry's name and the platform it builds on, as <CMAKE_SYSTEM_NAME>-<arch>
RUNNERS: '{"Linux": "Linux-x86_64", "macOS": "Darwin-arm64", "Windows": "Windows-AMD64"}'
run: |
python3 - <<'EOF'
import json, os, pathlib
runners = json.loads(os.environ["RUNNERS"])
if os.environ["PRODUCT"]:
products = [os.environ["PRODUCT"]]
else:
products = sorted(p.parent.name for p in pathlib.Path("products").glob("*/CMakeLists.txt"))
exclude = []
for product in products:
platforms_file = pathlib.Path("products", product, "PLATFORMS")
if platforms_file.exists():
lines = [line.strip() for line in platforms_file.read_text().splitlines()]
platforms = {line for line in lines if line and not line.startswith("#")}
exclude += [{"product": product, "name": name} for name, platform in runners.items()
if platform not in platforms]
# a runner must keep a product: matrix include would turn an entry whose name is left in no combination
# into a job of its own, with no product (e.g. dispatching dialogue). Such a runner builds what was asked.
for name in runners:
skipped = [e for e in exclude if e["name"] == name]
if len(skipped) == len(products):
print(f"::warning::{products} not supported on {name} ({runners[name]}); building it there anyway")
exclude = [e for e in exclude if e["name"] != name]
with open(os.environ["GITHUB_OUTPUT"], "a") as out:
out.write(f"products={json.dumps(products)}\n")
out.write(f"names={json.dumps(list(runners))}\n")
out.write(f"exclude={json.dumps(exclude)}\n")
print("products:", products, "\nskipped:", exclude)
EOF

build_and_test:
name: ${{ matrix.name }}
name: ${{ matrix.name }} (${{ matrix.product }})
needs: products
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
product: ${{ fromJSON(needs.products.outputs.products) }}
name: ${{ fromJSON(needs.products.outputs.names) }}
exclude: ${{ fromJSON(needs.products.outputs.exclude) }}
include:
- name: Linux
os: ubuntu-latest
Expand Down Expand Up @@ -80,7 +137,7 @@ jobs:
if: runner.os != 'Windows'
shell: bash
run: |
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DALTVANE_PRODUCTS=${{ inputs.product }} ${{ matrix.cmake_extra_flags }} .
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DALTVANE_PRODUCTS=${{ matrix.product }} ${{ matrix.cmake_extra_flags }} .
cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Configure and Build (Windows)
Expand All @@ -89,7 +146,7 @@ jobs:
run: |
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set VS_PATH=%%i
call "%VS_PATH%\VC\Auxiliary\Build\${{ matrix.vcvars_script }}"
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DALTVANE_PRODUCTS=${{ inputs.product }} ${{ matrix.cmake_extra_flags }} .
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DALTVANE_PRODUCTS=${{ matrix.product }} ${{ matrix.cmake_extra_flags }} .
cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Compiler cache stats
Expand All @@ -99,8 +156,8 @@ jobs:
- name: Read in the product's .env from CMake # written by altvane_add_plugin
shell: bash
run: |
cat "${{ env.BUILD_DIR }}/${{ inputs.product }}.env" # show us the config
cat "${{ env.BUILD_DIR }}/${{ inputs.product }}.env" >> $GITHUB_ENV # pull in our PRODUCT_NAME, etc
cat "${{ env.BUILD_DIR }}/${{ matrix.product }}.env" # show us the config
cat "${{ env.BUILD_DIR }}/${{ matrix.product }}.env" >> $GITHUB_ENV # pull in our PRODUCT_NAME, etc

- name: Pluginval setup
shell: bash
Expand Down
71 changes: 64 additions & 7 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
name: Sanitizer

on:
schedule:
- cron: "23 2 * * 6" # Saturdays, 02:23 UTC, every product (see the products job)
workflow_dispatch:
inputs:
product:
description: Product to test (directory name under products/)
required: true
default: eq

# When pushing new commits, cancel any running builds on that branch
# When pushing new commits, cancel any running builds on that branch (of this workflow: the scheduled run on main must
# not cancel, or be cancelled by, another workflow's run there)
concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
Expand All @@ -29,12 +32,66 @@ env:
CMAKE_CXX_COMPILER_LAUNCHER: sccache

jobs:
products:
# what to test: the product asked for or, on the schedule, every product; minus the runners a product can't build
# on (products/<product>/PLATFORMS, read as the top-level CMakeLists.txt does)
name: Products
runs-on: ubuntu-latest
outputs:
products: ${{ steps.list.outputs.products }}
names: ${{ steps.list.outputs.names }}
exclude: ${{ steps.list.outputs.exclude }}
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: List products and runners
id: list
shell: bash
env:
PRODUCT: ${{ inputs.product }}
# each build_and_test entry's name and the platform it builds on, as <CMAKE_SYSTEM_NAME>-<arch>
RUNNERS: '{"macOS Address Sanitizer": "Darwin-arm64", "macOS Thread Sanitizer": "Darwin-arm64", "Linux Address Sanitizer": "Linux-x86_64", "Linux Thread Sanitizer": "Linux-x86_64"}'
run: |
python3 - <<'EOF'
import json, os, pathlib
runners = json.loads(os.environ["RUNNERS"])
if os.environ["PRODUCT"]:
products = [os.environ["PRODUCT"]]
else:
products = sorted(p.parent.name for p in pathlib.Path("products").glob("*/CMakeLists.txt"))
exclude = []
for product in products:
platforms_file = pathlib.Path("products", product, "PLATFORMS")
if platforms_file.exists():
lines = [line.strip() for line in platforms_file.read_text().splitlines()]
platforms = {line for line in lines if line and not line.startswith("#")}
exclude += [{"product": product, "name": name} for name, platform in runners.items()
if platform not in platforms]
# a runner must keep a product: matrix include would turn an entry whose name is left in no combination
# into a job of its own, with no product (e.g. dispatching dialogue). Such a runner builds what was asked.
for name in runners:
skipped = [e for e in exclude if e["name"] == name]
if len(skipped) == len(products):
print(f"::warning::{products} not supported on {name} ({runners[name]}); building it there anyway")
exclude = [e for e in exclude if e["name"] != name]
with open(os.environ["GITHUB_OUTPUT"], "a") as out:
out.write(f"products={json.dumps(products)}\n")
out.write(f"names={json.dumps(list(runners))}\n")
out.write(f"exclude={json.dumps(exclude)}\n")
print("products:", products, "\nskipped:", exclude)
EOF

build_and_test:
name: ${{ matrix.name }}
name: ${{ matrix.name }} (${{ matrix.product }})
needs: products
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
product: ${{ fromJSON(needs.products.outputs.products) }}
name: ${{ fromJSON(needs.products.outputs.names) }}
exclude: ${{ fromJSON(needs.products.outputs.exclude) }}
include:
- name: macOS Address Sanitizer
os: macos-latest
Expand Down Expand Up @@ -86,15 +143,15 @@ jobs:
if: runner.os != 'Windows'
shell: bash
run: |
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DALTVANE_PRODUCTS=${{ inputs.product }} -DALTVANE_LTO=OFF ${{ matrix.cmake_extra_flags }} .
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DALTVANE_PRODUCTS=${{ matrix.product }} -DALTVANE_LTO=OFF ${{ matrix.cmake_extra_flags }} .
cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Configure and Build (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
call ${{ matrix.vcvars64_path }}
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DALTVANE_PRODUCTS=${{ inputs.product }} -DALTVANE_LTO=OFF ${{ matrix.cmake_extra_flags }} .
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DALTVANE_PRODUCTS=${{ matrix.product }} -DALTVANE_LTO=OFF ${{ matrix.cmake_extra_flags }} .
cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }}

- name: Compiler cache stats
Expand All @@ -104,8 +161,8 @@ jobs:
- name: Read in the product's .env from CMake # written by altvane_add_plugin
shell: bash
run: |
cat "${{ env.BUILD_DIR }}/${{ inputs.product }}.env" # show us the config
cat "${{ env.BUILD_DIR }}/${{ inputs.product }}.env" >> $GITHUB_ENV # pull in our PRODUCT_NAME, etc
cat "${{ env.BUILD_DIR }}/${{ matrix.product }}.env" # show us the config
cat "${{ env.BUILD_DIR }}/${{ matrix.product }}.env" >> $GITHUB_ENV # pull in our PRODUCT_NAME, etc

- name: Checkout pluginval code
uses: actions/checkout@v7
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/upstream_watch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Upstream Watch

# How far each vendored engine (products/*/UPSTREAM) is behind its upstream repository's main branch.
# Keeps a single tracking issue (labelled upstream-watch) up to date and closes it once every engine is current.
# It only reports: it never changes code or opens pull requests (moving a pin is scripts/sync_upstream.sh's job).

on:
schedule:
- cron: "17 6 * * 1" # Mondays, 06:17 UTC
workflow_dispatch:

permissions:
contents: read
issues: write

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

env:
ISSUE_LABEL: upstream-watch
ISSUE_TITLE: Vendored engines are behind upstream

jobs:
report:
name: Compare pins with upstream
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: List upstream commits since each pin
shell: bash
run: |
set -euo pipefail
run_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
marker="" behind_total=0 table="" details=""
for pin in products/*/UPSTREAM; do
product=$(basename "$(dirname "$pin")")
repo=$(bash -c 'source "$1"; echo "${REPO%.git}"' _ "$pin")
commit=$(bash -c 'source "$1"; echo "$COMMIT"' _ "$pin")
scripts/upstream_behind.sh "$product" > "behind-$product.tsv"
count=$(wc -l < "behind-$product.tsv" | tr -d ' ')
behind_total=$((behind_total + count))
marker+=" $product=$count"
if [ "$count" -eq 0 ]; then
behind="current"
else
noun=$([ "$count" -eq 1 ] && echo commit || echo commits)
behind="[$count $noun]($repo/compare/$commit...main)"
details+=$'\n'"<details><summary>$product: $count $noun</summary>"$'\n\n'
# subjects go in code spans so upstream's @mentions and #numbers don't ping or link anything here
while IFS=$'\t' read -r sha date subject; do
subject=$(printf '%s' "$subject" | tr '`' "'")
details+="- [\`${sha:0:7}\`]($repo/commit/$sha) $date \`$subject\`"$'\n'
done < "behind-$product.tsv"
details+=$'\n'"</details>"$'\n'
fi
table+="| $product | [${repo#https://github.com/}]($repo) | [\`${commit:0:7}\`]($repo/commit/$commit) | $behind |"$'\n'
done
{
echo "<!-- upstream-watch:$marker -->"
echo "Commits on each vendored engine's upstream \`main\` since its pin in \`products/<product>/UPSTREAM\`,"
echo "as of $(date -u +%Y-%m-%d) ([run]($run_url))."
echo
echo "| Product | Upstream | Pinned at | Behind |"
echo "|---|---|---|---|"
printf '%s' "$table"
printf '%s' "$details"
echo
echo "To take them: \`scripts/sync_upstream.sh <product>\`, port the changes it lists to the files the product"
echo "adapted, then build and test. This issue is updated weekly by the Upstream Watch workflow and closed once"
echo "every engine is current."
} > report.md
cat report.md >> "$GITHUB_STEP_SUMMARY"
echo "BEHIND_TOTAL=$behind_total" >> "$GITHUB_ENV"

- name: Update the tracking issue
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
number=$(gh issue list --label "$ISSUE_LABEL" --state open --limit 1 --json number --jq '.[0].number // empty')
if [ "$BEHIND_TOTAL" -eq 0 ]; then
if [ -n "$number" ]; then
gh issue close "$number" --comment "All vendored engines are current with upstream as of $(date -u +%Y-%m-%d)."
fi
echo "All vendored engines are current with upstream."
exit 0
fi
if [ -z "$number" ]; then
gh label create "$ISSUE_LABEL" --color FBCA04 --description "Vendored engines behind upstream" --force
gh issue create --title "$ISSUE_TITLE" --label "$ISSUE_LABEL" --body-file report.md
exit 0
fi
previous=$(gh issue view "$number" --json body --jq '.body' | head -n 1 | tr -d '\r')
current=$(head -n 1 report.md)
gh issue edit "$number" --title "$ISSUE_TITLE" --body-file report.md
# a comment (which notifies) only when the counts changed, not every week
if [ "$previous" != "$current" ]; then
counts=$(echo "$current" | sed -E 's/<!-- upstream-watch: (.*) -->/\1/')
gh issue comment "$number" --body "Upstream moved: now behind by $counts. The table above is updated."
fi
4 changes: 4 additions & 0 deletions libs/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/source" PREFIX "" FILES ${ui_file
target_include_directories(altvane_ui INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/source")
target_compile_features(altvane_ui INTERFACE cxx_std_20)
target_link_libraries(altvane_ui INTERFACE altvane_ui_assets juce_gui_basics juce_audio_processors)

if (ALTVANE_BUILD_TESTS)
add_subdirectory(tests)
endif ()
Loading
Loading