File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,23 @@ name: prof-correctness
22on :
33 push :
44 schedule :
5- - cron : ' 0 0 * * *'
5+ - cron : " 0 0 * * *"
66jobs :
7+ ruff :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
11+ - name : Set up Python
12+ uses : actions/setup-python@v5
13+ with :
14+ python-version : " 3.11"
15+ - name : Install ruff
16+ run : pip install --no-cache-dir ruff
17+ - name : Run ruff format check
18+ run : ruff format --check .
19+ - name : Run ruff lint check
20+ if : success() || failure()
21+ run : ruff check .
722 ddprof :
823 uses : ./.github/workflows/test.yml
924 with :
Original file line number Diff line number Diff line change 77def target (n ):
88 sleep (n )
99
10+
1011if __name__ == "__main__" :
1112 # Simple application that creates two threads with different durations:
1213 # - MainThread runs target() for 2 seconds
Original file line number Diff line number Diff line change 44x = 0
55i = 0
66
7+
78def main ():
89 global x , i
9- EXECUTION_TIME_SEC = int (os .getenv ("EXECUTION_TIME_SEC" , "10" )) # defaults to 10 if not set
10+ EXECUTION_TIME_SEC = int (
11+ os .getenv ("EXECUTION_TIME_SEC" , "10" )
12+ ) # defaults to 10 if not set
1013 end = time () + EXECUTION_TIME_SEC
1114 while time () < end :
1215 a ()
1316 b ()
1417 # We add a print to prevent optimization that could turn this into a no-op program
1518 print (x )
1619
20+
1721def a ():
1822 global x , i
1923 i = 0
2024 while i < 1000000 :
2125 x += i
2226 i += 1
2327
28+
2429def b ():
2530 global x , i
2631 i = 0
2732 while i < 2000000 :
2833 x += i
2934 i += 1
3035
36+
3137main ()
You can’t perform that action at this time.
0 commit comments