|
| 1 | +### DO NOT EDIT - created by a script ### |
| 2 | +name: clang_p3822 via clang p3822-trunk |
| 3 | + |
| 4 | +on: |
| 5 | + schedule: |
| 6 | + - cron: '0 0 * * *' |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + check-activity: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + outputs: |
| 13 | + should_build: ${{ steps.check.outputs.should_build }} |
| 14 | + steps: |
| 15 | + - name: Check for recent commits |
| 16 | + id: check |
| 17 | + run: | |
| 18 | + REPOS='["https://github.com/yuxuanchen1997/llvm-project/tree/users/yuxuanchen1997/p3822r0-requirements-noexcept"]' |
| 19 | + STALE_DAYS=7 |
| 20 | +
|
| 21 | + SINCE_DATE=$(date -d "${STALE_DAYS} days ago" --iso-8601=seconds) |
| 22 | + echo "Checking for commits since ${SINCE_DATE} (${STALE_DAYS} days ago)" |
| 23 | + HAS_RECENT=false |
| 24 | +
|
| 25 | + for repo in $(echo "$REPOS" | jq -r '.[]'); do |
| 26 | + REPO_PATH=$(echo "$repo" | sed -E 's|https://github.com/([^/]+/[^/]+).*|\1|') |
| 27 | + BRANCH=$(echo "$repo" | sed -n -E 's|https://github.com/[^/]+/[^/]+/tree/(.+)|\1|p') |
| 28 | +
|
| 29 | + if [ -n "$BRANCH" ]; then |
| 30 | + echo "Checking $REPO_PATH (branch: $BRANCH) for recent commits..." |
| 31 | + COMMITS=$(curl -sf "https://api.github.com/repos/${REPO_PATH}/commits?sha=${BRANCH}&since=${SINCE_DATE}&per_page=1" || echo "[]") |
| 32 | + else |
| 33 | + echo "Checking $REPO_PATH (default branch) for recent commits..." |
| 34 | + COMMITS=$(curl -sf "https://api.github.com/repos/${REPO_PATH}/commits?since=${SINCE_DATE}&per_page=1" || echo "[]") |
| 35 | + fi |
| 36 | +
|
| 37 | + if [ "$(echo "$COMMITS" | jq 'length')" -gt 0 ]; then |
| 38 | + echo "Found recent commits in $repo" |
| 39 | + HAS_RECENT=true |
| 40 | + break |
| 41 | + fi |
| 42 | + done |
| 43 | +
|
| 44 | + if [ "$HAS_RECENT" = "true" ]; then |
| 45 | + echo "should_build=true" >> "$GITHUB_OUTPUT" |
| 46 | + else |
| 47 | + echo "No recent commits in any repo (within ${STALE_DAYS} days), skipping build" |
| 48 | + echo "should_build=false" >> "$GITHUB_OUTPUT" |
| 49 | + fi |
| 50 | +
|
| 51 | + daily-build: |
| 52 | + needs: check-activity |
| 53 | + if: ${{ needs.check-activity.outputs.should_build == 'true' }} |
| 54 | + runs-on: [ 'self-hosted', 'ce', 'linux', 'x64' ] |
| 55 | + steps: |
| 56 | + - name: Start from a clean directory |
| 57 | + uses: AutoModality/action-clean@v1.1.0 |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + - name: Run the build |
| 60 | + uses: ./.github/actions/daily-build |
| 61 | + with: |
| 62 | + image: clang |
| 63 | + name: clang_p3822 |
| 64 | + command: build.sh |
| 65 | + args: p3822-trunk |
| 66 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 67 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
0 commit comments