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
20 changes: 18 additions & 2 deletions .github/workflows/codeflash-optimize.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CodeFlash

on:
pull_request:
pull_request_target:
paths:
- "**"
workflow_dispatch:
Expand All @@ -13,6 +13,7 @@ concurrency:
jobs:
optimize:
name: Optimize new Python code
environment: external-trusted-contributors
if: ${{ github.actor != 'codeflash-ai[bot]' }}
runs-on: ubuntu-latest
env:
Expand All @@ -26,6 +27,21 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."
# Check if the PR author is allowed
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
else
echo "Authorized user ($AUTHOR). Proceeding."
fi
fi
- name: 🐍 Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
Expand All @@ -43,4 +59,4 @@ jobs:
id: optimize_code
run: |
source .venv/bin/activate
poetry run codeflash
poetry run codeflash
18 changes: 17 additions & 1 deletion .github/workflows/end-to-end-test-bubblesort-pytest-no-git.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: end-to-end-test

on:
pull_request:
pull_request_target:
workflow_dispatch:

jobs:
bubble-sort-optimization-pytest-no-git:
environment: external-trusted-contributors
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand All @@ -21,6 +22,21 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."

# Check if the PR author is allowed
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
else
echo "Authorized user ($AUTHOR). Proceeding."
fi
fi

- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/end-to-end-test-bubblesort-unittest.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: end-to-end-test

on:
pull_request:
pull_request_target:
workflow_dispatch:

jobs:
bubble-sort-optimization-unittest:
environment: external-trusted-contributors
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand All @@ -21,6 +22,21 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."

# Check if the PR author is allowed
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
else
echo "Authorized user ($AUTHOR). Proceeding."
fi
fi

- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
Expand All @@ -38,4 +54,4 @@ jobs:
id: optimize_code
run: |
source .venv/bin/activate
poetry run python tests/scripts/end_to_end_test_bubblesort_unittest.py
poetry run python tests/scripts/end_to_end_test_bubblesort_unittest.py
20 changes: 18 additions & 2 deletions .github/workflows/end-to-end-test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Coverage E2E

on:
pull_request:
pull_request_target:
workflow_dispatch:

jobs:
end-to-end-test-coverage:
environment: external-trusted-contributors
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand All @@ -19,6 +20,21 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."

# Check if the PR author is allowed
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
else
echo "Authorized user ($AUTHOR). Proceeding."
fi
fi

- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
Expand All @@ -37,4 +53,4 @@ jobs:
id: optimize_code
run: |
source .venv/bin/activate
poetry run python tests/scripts/end_to_end_test_coverage.py
poetry run python tests/scripts/end_to_end_test_coverage.py
20 changes: 18 additions & 2 deletions .github/workflows/end-to-end-test-futurehouse.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: end-to-end-test

on:
pull_request:
pull_request_target:
workflow_dispatch:

jobs:
futurehouse-structure:
environment: external-trusted-contributors
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand All @@ -21,6 +22,21 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."

# Check if the PR author is allowed
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
else
echo "Authorized user ($AUTHOR). Proceeding."
fi
fi

- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
Expand All @@ -38,4 +54,4 @@ jobs:
id: optimize_code
run: |
source .venv/bin/activate
poetry run python tests/scripts/end_to_end_test_futurehouse.py
poetry run python tests/scripts/end_to_end_test_futurehouse.py
20 changes: 18 additions & 2 deletions .github/workflows/end-to-end-test-init-optim.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: end-to-end-test

on:
pull_request:
pull_request_target:
workflow_dispatch:

jobs:
init-optimization:
environment: external-trusted-contributors
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand All @@ -21,6 +22,21 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."

# Check if the PR author is allowed
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
else
echo "Authorized user ($AUTHOR). Proceeding."
fi
fi

- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
Expand All @@ -38,4 +54,4 @@ jobs:
id: optimize_code
run: |
source .venv/bin/activate
poetry run python tests/scripts/end_to_end_test_init_optimization.py
poetry run python tests/scripts/end_to_end_test_init_optimization.py
21 changes: 19 additions & 2 deletions .github/workflows/end-to-end-test-tracer-replay.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: end-to-end-test

on:
pull_request:
pull_request_target:
workflow_dispatch:

jobs:
tracer-replay:
environment: external-trusted-contributors
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand All @@ -21,6 +22,22 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."

# Check if the PR author is allowed
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
else
echo "Authorized user ($AUTHOR). Proceeding."
fi
fi


- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
Expand All @@ -38,4 +55,4 @@ jobs:
id: optimize_code
run: |
source .venv/bin/activate
poetry run python tests/scripts/end_to_end_test_tracer_replay.py
poetry run python tests/scripts/end_to_end_test_tracer_replay.py
23 changes: 21 additions & 2 deletions .github/workflows/end-to-end-topological-sort-test.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: end-to-end-test

on:
pull_request:
pull_request_target:
workflow_dispatch:

jobs:
topological-sort-optimization:
environment: external-trusted-contributors
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand All @@ -21,6 +22,24 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."

# Check if the PR author is allowed
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
else
echo "Authorized user ($AUTHOR). Proceeding."
fi
fiif git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-topological-sort-test.yaml"; then
echo "This workflow file has been modified. Exiting for security."
exit 1
fi

- name: Set up Python 3.11 for CLI
uses: astral-sh/setup-uv@v5
Expand All @@ -38,4 +57,4 @@ jobs:
id: optimize_code
run: |
source .venv/bin/activate
poetry run python tests/scripts/end_to_end_test_topological_sort.py
poetry run python tests/scripts/end_to_end_test_topological_sort.py
Loading