Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aphexcx committed Dec 15, 2023
1 parent ca0dce6 commit 375b979
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/codeflash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
id: optimize_code
run: |
poetry env use python
poetry run codeflash --test-framework unittest --test-root code_to_optimize/tests/unittest
poetry run codeflash
33 changes: 33 additions & 0 deletions .github/workflows/optimize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CodeFlash

on:
pull_request:
workflow_dispatch:

jobs:
optimize:
name: Optimize new code in this PR
runs-on: ubuntu-latest
env:
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
CODEFLASH_AI_KEY: ${{ secrets.CODEFLASH_AI_KEY }}
PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run CodeFlash to optimize code
id: optimize_code
run: |
poetry env use python
poetry run codeflash --test-framework unittest --test-root code_to_optimize/tests/unittest
22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[tool.poetry]
name = "my-best-repo"
version = "0.1.0"
description = ""
authors = ["afik.cohen <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
codeflash = {url = "https://www.dropbox.com/scl/fi/nif03u6oj327bn476h11i/codeflash-0.4.3.post1.dev0-50ba298-py3-none-any.whl?rlkey=uoy9h6wcjtktds84idqjkdmza&dl=1"}


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"


[tool.codeflash]
root = "/Users/afik_cohen/repos/tacit/my-best-repo"
test-root = "/Users/afik_cohen/repos/tacit/my-best-repo/tests/pytests/"
test-framework = "pytest"
ignore-paths = ["tests/"]

0 comments on commit 375b979

Please sign in to comment.