Incorporate llmclient as lcaw #353
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
name: CodeFlash | |
on: | |
pull_request: | |
paths: | |
- "src/**" | |
- "packages/**" | |
workflow_dispatch: | |
concurrency: # Cancel prior if new push, SEE: https://stackoverflow.com/a/72408109 | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
optimize: # SEE: https://docs.codeflash.ai/getting-started/codeflash-github-actions | |
runs-on: ubuntu-latest | |
env: | |
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }} | |
CODEFLASH_PR_NUMBER: ${{ github.event.number }} | |
steps: | |
- name: Check if PR is from CodeFlash bot | |
id: bot_check | |
working-directory: . | |
run: | | |
echo "Checking if this PR is created by CodeFlash bot..." | |
if [ "${{ github.event.pull_request.user.login }}" == "codeflash-ai[bot]" ]; then | |
echo "PR created by Codeflash bot. Skipping optimization." | |
echo "skip_remaining_steps=yes" >> $GITHUB_OUTPUT | |
else | |
echo "skip_remaining_steps=no" >> $GITHUB_OUTPUT | |
echo "It's not. Proceeding with the optimization." | |
fi | |
- if: steps.bot_check.outputs.skip_remaining_steps == 'no' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- if: steps.bot_check.outputs.skip_remaining_steps == 'no' | |
uses: astral-sh/setup-uv@v4 | |
with: | |
enable-cache: true | |
- if: steps.bot_check.outputs.skip_remaining_steps == 'no' | |
run: uv sync --group=codeflash | |
- if: steps.bot_check.outputs.skip_remaining_steps == 'no' | |
name: Run CodeFlash on ldp | |
run: uv run codeflash --module-root=src/ldp --tests-root=tests | |
- if: steps.bot_check.outputs.skip_remaining_steps == 'no' | |
name: Run CodeFlash on lcaw | |
run: uv run codeflash --module-root=packages/lcaw/src/lcaw --tests-root=packages/lcaw/tests |