-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: CI | ||
|
||
on: | ||
schedule: | ||
- cron: "0 */1 * * *" | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
concurrency: | ||
group: single | ||
cancel-in-progress: false | ||
|
||
runs-on: self-hosted | ||
|
||
permissions: | ||
issues: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Set up Git | ||
run: | | ||
git config --global user.name "${{ github.actor }}" | ||
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
- name: Update LLVM | ||
run: ${{ github.workspace }}/scripts/update_llvm.sh | ||
|
||
- name: Update optimized IR | ||
id: update | ||
run: ${{ github.workspace }}/scripts/update_optimized.sh | ||
|
||
- name: Report | ||
uses: JasonEtco/create-an-issue@v2 | ||
if: steps.update.outputs.SHOULD_OPEN_ISSUE == '1' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
filename: scripts/issue.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
bench_build | ||
llvm-build | ||
CHANGELOGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/python3 | ||
import sys | ||
import html | ||
|
||
commit_hash = sys.argv[1] | ||
report_file = "scripts/issue.md" | ||
|
||
def dump_pretty_change_logs(report, change_logs_path): | ||
report.write('## Change Logs\n') | ||
|
||
with open(change_logs_path, "r") as change_logs: | ||
for line in change_logs.readlines(): | ||
if len(line) > 40 and line[:40].isalnum() and not line.startswith('from'): | ||
commit_id = line[:40] | ||
remain = line[40:] | ||
report.write( | ||
"[{0}](https://github.com/llvm/llvm-project/commit/{0}){1}\n".format(commit_id, html.escape(remain.removesuffix('\n')))) | ||
else: | ||
report.write(line) | ||
|
||
with open(report_file, 'w') as issue_report: | ||
issue_report.write('---\n') | ||
issue_report.write( | ||
"title: Update diff {{ date | date('MMMM Do YYYY, h:mm:ss a') }}\n") | ||
issue_report.write('---\n') | ||
issue_report.write('commit: {}\n'.format(commit_hash)) | ||
issue_report.write('\n') | ||
dump_pretty_change_logs(issue_report, 'CHANGELOGS') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
title: Internal CI Error | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
shopt -s inherit_errexit | ||
|
||
last_commit=$(git -C llvm/llvm-project rev-parse HEAD) | ||
git submodule update --remote --merge llvm/llvm-project | ||
current_commit=$(git -C llvm/llvm-project rev-parse HEAD) | ||
echo -e "from $last_commit to $current_commit\n" > CHANGELOGS | ||
git log $last_commit..HEAD --pretty=oneline >> CHANGELOGS | ||
cat CHANGELOGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p llvm/llvm-build | ||
cd llvm/llvm-build | ||
cmake ../llvm-project/llvm -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -G Ninja \ | ||
-DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_OPTIMIZED_TABLEGEN=ON \ | ||
-DLLVM_ENABLE_WARNINGS=OFF -DLLVM_APPEND_VC_REV=OFF -DLLVM_TARGETS_TO_BUILD="X86;" \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
cmake --build . -j -t opt | ||
cd ../.. | ||
|
||
scripts/gen_optimized.py bench $LLVM_OPT_BENCHMARK_WORKSPACE/llvm-build/bin/opt | ||
llvm_commit=$(git -C llvm/llvm-project rev-parse HEAD) | ||
git commit -a -m "llvm: Update baseline to $llvm_commit" | ||
if [ $? -eq 0 ] | ||
then | ||
git push -u origin | ||
git show --name-only | grep bench | ||
if [ $? -eq 0 ] | ||
then | ||
scripts/gen_issue_report.py $(git rev-parse HEAD) | ||
echo "SHOULD_OPEN_ISSUE=1" >> $GITHUB_OUTPUT | ||
else | ||
echo "SHOULD_OPEN_ISSUE=0" >> $GITHUB_OUTPUT | ||
fi | ||
else | ||
echo "SHOULD_OPEN_ISSUE=0" >> $GITHUB_OUTPUT | ||
fi |