Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial population #1

Merged
merged 5 commits into from
Sep 4, 2024
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
42 changes: 42 additions & 0 deletions .github/workflows/codeflash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CodeFlash

on:
pull_request:
paths:
- "ldp/**"
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
- name: Set up uv
if: steps.bot_check.outputs.skip_remaining_steps == 'no'
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- if: steps.bot_check.outputs.skip_remaining_steps == 'no'
run: uv sync
- if: steps.bot_check.outputs.skip_remaining_steps == 'no'
run: uv run codeflash
20 changes: 20 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish

on:
release:
types: [created]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv sync
- name: Build a binary wheel and a source tarball
run: uv run python -m build --sdist --wheel --outdir dist/ .
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint and Test

on:
push:
branches: [main]
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' # pre-commit-ci/lite-action only runs here
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- uses: pre-commit/action@v3.0.1
- uses: pre-commit-ci/lite-action@v1.0.2
if: always()
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv sync
- run: uv run refurb ldp tests
- run: uv run pylint ldp tests
test:
runs-on: large-runner
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv sync
- run: uv run pytest -n 16 --dist=loadfile # auto only launches 8 workers in CI, despite runners have 16 cores
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
Loading
Loading