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
97 changes: 97 additions & 0 deletions .github/workflows/build-daily-edg.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions build-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions compilers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Loading