diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml new file mode 100644 index 000000000..1e30e0ba7 --- /dev/null +++ b/.github/workflows/baseline.yml @@ -0,0 +1,35 @@ +name: baseline + +on: + push: + branches: [main] + paths: + - "libs/**" + +env: + POETRY_VERSION: "1.7.1" + +jobs: + benchmark: + runs-on: ubuntu-latest + defaults: + run: + working-directory: libs/langgraph + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_setup" + with: + python-version: "3.11" + poetry-version: ${{ env.POETRY_VERSION }} + cache-key: bench + - name: Install dependencies + run: poetry install --with dev + - name: Run benchmarks + run: OUTPUT=out/benchmark-baseline.json make -s benchmark + - name: Save outputs + uses: actions/cache/save@v4 + with: + key: ${{ runner.os }}-benchmark-baseline + path: | + libs/langgraph/out/benchmark-baseline.json diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 1e1117e5c..b5af5ea01 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -9,30 +9,6 @@ env: POETRY_VERSION: "1.7.1" jobs: - baseline: - runs-on: ubuntu-latest - defaults: - run: - working-directory: libs/langgraph - steps: - - uses: actions/checkout@v4 - with: - ref: main - - name: Set up Python 3.11 + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: "3.11" - poetry-version: ${{ env.POETRY_VERSION }} - cache-key: bench - - name: Install dependencies - run: poetry install --with dev - - name: Run benchmarks - run: OUTPUT=out/benchmark-baseline.json make -s benchmark - - name: Upload benchmark baseline - uses: actions/upload-artifact@v4 - with: - name: benchmark-baseline - path: libs/langgraph/out/benchmark-baseline.json benchmark: runs-on: ubuntu-latest defaults: @@ -54,6 +30,13 @@ jobs: cache-key: bench - name: Install dependencies run: poetry install --with dev + - name: Download baseline + uses: actions/cache/restore@v4 + with: + key: ${{ runner.os }}-benchmark-baseline + fail-on-cache-miss: true + path: | + libs/langgraph/out/benchmark-baseline.json - name: Run benchmarks id: benchmark run: | @@ -62,17 +45,14 @@ jobs: make -s benchmark echo EOF } >> "$GITHUB_OUTPUT" - - name: Download benchmark baseline - uses: actions/download-artifact@v4 - with: - path: libs/langgraph/out - merge-multiple: true - name: Compare benchmarks id: compare run: | { echo 'OUTPUT<> "$GITHUB_OUTPUT" - name: Annotation