File: codeflash.yaml

package info (click to toggle)
strawberry-graphql 0.306.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,176 kB
  • sloc: javascript: 178,052; python: 65,643; sh: 33; makefile: 25
file content (41 lines) | stat: -rw-r--r-- 1,351 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Codeflash

on:
  pull_request:
    paths:
      # So that this workflow only runs when code within the target module is modified
      - "strawberry/**"
  workflow_dispatch:

concurrency:
  # Any new push to the PR will cancel the previous run, so that only the latest code is optimized
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  optimize:
    name: Optimize new Python code in this PR
    # Don't run codeflash on codeflash-ai[bot] commits, prevent duplicate optimizations
    if: ${{ github.actor != 'codeflash-ai[bot]' }}
    runs-on: ubuntu-latest
    env:
      CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
      CODEFLASH_PR_NUMBER: ${{ github.event.number }}

    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
        with:
          fetch-depth: 0
      - name: Set up Python
        uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
        with:
          python-version: "3.11"
      - name: Install Project Dependencies
        run: |
          python -m pip install --upgrade pip
          pip install poetry
          poetry install --all-extras
      - name: Run Codeflash to optimize code
        run: |
          poetry env use python
          poetry run codeflash --benchmark --benchmarks-root tests/benchmarks