From 6d4214d56fdd5dfc0b6352fc282c1a8ef6515ae1 Mon Sep 17 00:00:00 2001 From: mattgodbolt-molty Date: Wed, 30 Sep 2026 11:47:27 -0500 Subject: [PATCH] Build open-source EDG trunk daily Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_019UuPJbXuMH8A4DCDNoiBiv --- .github/workflows/build-daily-edg.yml | 97 +++++++++++++++++++++++++++ build-status.md | 1 + compilers.yaml | 1 + 3 files changed, 99 insertions(+) create mode 100644 .github/workflows/build-daily-edg.yml diff --git a/.github/workflows/build-daily-edg.yml b/.github/workflows/build-daily-edg.yml new file mode 100644 index 0000000..dfef696 --- /dev/null +++ b/.github/workflows/build-daily-edg.yml @@ -0,0 +1,97 @@ +### DO NOT EDIT - created by a script ### +name: edg via edg trunk + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + inputs: + install: + description: 'Install to Compiler Explorer after a successful build' + type: boolean + default: true + +jobs: + check-activity: + runs-on: ubuntu-latest + outputs: + should_build: ${{ steps.check.outputs.should_build }} + steps: + - name: Check for recent commits + id: check + env: + GH_TOKEN: ${{ github.token }} + run: | + REPOS='["https://github.com/edgcpp/compiler/tree/main"]' + STALE_DAYS=7 + + SINCE_DATE=$(date -d "${STALE_DAYS} days ago" --iso-8601=seconds) + echo "Checking for commits since ${SINCE_DATE} (${STALE_DAYS} days ago)" + HAS_RECENT=false + + for repo in $(echo "$REPOS" | jq -r '.[]'); do + REPO_PATH=$(echo "$repo" | sed -E 's|https://github.com/([^/]+/[^/]+).*|\1|') + BRANCH=$(echo "$repo" | sed -n -E 's|https://github.com/[^/]+/[^/]+/tree/(.+)|\1|p') + + if [ -n "$BRANCH" ]; then + echo "Checking $REPO_PATH (branch: $BRANCH) for recent commits..." + URL="https://api.github.com/repos/${REPO_PATH}/commits?sha=${BRANCH}&since=${SINCE_DATE}&per_page=1" + else + echo "Checking $REPO_PATH (default branch) for recent commits..." + URL="https://api.github.com/repos/${REPO_PATH}/commits?since=${SINCE_DATE}&per_page=1" + fi + + # Authenticate to avoid the 60 req/hour anonymous limit (shared across runner IPs). + # On any API failure, build anyway rather than silently treating it as "no activity". + if ! COMMITS=$(curl -sf \ + -H "Authorization: Bearer ${GH_TOKEN}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "$URL"); then + echo "::warning::GitHub API request failed for $REPO_PATH; building to be safe" + HAS_RECENT=true + break + fi + + if [ "$(echo "$COMMITS" | jq 'length')" -gt 0 ]; then + echo "Found recent commits in $repo" + HAS_RECENT=true + break + fi + done + + if [ "$HAS_RECENT" = "true" ]; then + echo "should_build=true" >> "$GITHUB_OUTPUT" + else + echo "No recent commits in any repo (within ${STALE_DAYS} days), skipping build" + echo "should_build=false" >> "$GITHUB_OUTPUT" + fi + + daily-build: + needs: check-activity + if: ${{ needs.check-activity.outputs.should_build == 'true' }} + runs-on: [ 'self-hosted', 'ce', 'linux', 'x64', 'small' ] + outputs: + status: ${{ steps.build.outputs.status }} + steps: + - name: Start from a clean directory + run: sudo find "$GITHUB_WORKSPACE" -mindepth 1 -delete + - uses: actions/checkout@v7 + - name: Run the build + id: build + uses: ./.github/actions/daily-build + with: + image: edg + name: edg + command: build.sh + args: trunk + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + install: + needs: daily-build + if: ${{ github.event_name == 'workflow_dispatch' && inputs.install && needs.daily-build.outputs.status == 'OK' }} + uses: ./.github/workflows/install-compilers.yml + with: + compilers: "nightly/edgcpp" + enable_nightly: true + force: true diff --git a/build-status.md b/build-status.md index 23d9a45..276eba9 100644 --- a/build-status.md +++ b/build-status.md @@ -58,6 +58,7 @@ * [![Status](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-cppfront.yml/badge.svg)](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-cppfront.yml)![Last success](https://img.shields.io/badge/dynamic/json?color=success&label=Last+OK&query=%24.last_success.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fcppfront)![Last build](https://img.shields.io/badge/dynamic/json?color=yellow&label=Last+build&query=%24.last_build.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fcppfront) * [![Status](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-dotnet.yml/badge.svg)](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-dotnet.yml)![Last success](https://img.shields.io/badge/dynamic/json?color=success&label=Last+OK&query=%24.last_success.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fdotnet)![Last build](https://img.shields.io/badge/dynamic/json?color=yellow&label=Last+build&query=%24.last_build.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fdotnet) * [![Status](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-dxc.yml/badge.svg)](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-dxc.yml)![Last success](https://img.shields.io/badge/dynamic/json?color=success&label=Last+OK&query=%24.last_success.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fdxc)![Last build](https://img.shields.io/badge/dynamic/json?color=yellow&label=Last+build&query=%24.last_build.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fdxc) +* [![Status](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-edg.yml/badge.svg)](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-edg.yml)![Last success](https://img.shields.io/badge/dynamic/json?color=success&label=Last+OK&query=%24.last_success.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fedg)![Last build](https://img.shields.io/badge/dynamic/json?color=yellow&label=Last+build&query=%24.last_build.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fedg) * [![Status](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-gcc.yml/badge.svg)](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-gcc.yml)![Last success](https://img.shields.io/badge/dynamic/json?color=success&label=Last+OK&query=%24.last_success.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fgcc)![Last build](https://img.shields.io/badge/dynamic/json?color=yellow&label=Last+build&query=%24.last_build.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fgcc) * [![Status](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-gcc.thephd.dev.yml/badge.svg)](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-gcc.thephd.dev.yml)![Last success](https://img.shields.io/badge/dynamic/json?color=success&label=Last+OK&query=%24.last_success.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fgcc.thephd.dev)![Last build](https://img.shields.io/badge/dynamic/json?color=yellow&label=Last+build&query=%24.last_build.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fgcc.thephd.dev) * [![Status](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-gcc_contracts.yml/badge.svg)](https://github.com/compiler-explorer/compiler-workflows/actions/workflows//build-daily-gcc_contracts.yml)![Last success](https://img.shields.io/badge/dynamic/json?color=success&label=Last+OK&query=%24.last_success.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fgcc_contracts)![Last build](https://img.shields.io/badge/dynamic/json?color=yellow&label=Last+build&query=%24.last_build.timestamp&url=https%3A%2F%2Flambda.compiler-explorer.com%2Fcompiler-build%2Fgcc_contracts) diff --git a/compilers.yaml b/compilers.yaml index a80da22..1a9da00 100644 --- a/compilers.yaml +++ b/compilers.yaml @@ -71,6 +71,7 @@ compilers: - { image: go, name: go , size: small} - { image: ccc, name: ccc, command: build.sh, args: main, repos: ["https://github.com/anthropics/claudes-c-compiler/tree/main"] , size: small} - { image: aburi, name: aburi, command: build.sh, args: godbolt, install: aburi godbolt, repos: ["https://github.com/serjective/aburi/tree/godbolt"], size: small } + - { image: edg, name: edg, command: build.sh, args: trunk, install: nightly/edgcpp, repos: ["https://github.com/edgcpp/compiler/tree/main"], size: small } - { image: misc, name: tinycc, command: build-tinycc.sh , size: small} - { image: misc, name: cc65, command: buildcc65.sh, repos: ["https://github.com/cc65/cc65/tree/master"] , size: small} - { image: misc, name: mrustc, command: build-mrustc.sh, args: master, repos: ["https://github.com/thepowersgang/mrustc/tree/master"] , size: small}