diff --git a/.github/workflows/benchmarks-merge.yml b/.github/workflows/benchmarks-merge.yml index ff1f5dd..140ccae 100644 --- a/.github/workflows/benchmarks-merge.yml +++ b/.github/workflows/benchmarks-merge.yml @@ -1,10 +1,10 @@ -name: TrustyAI Python benchmarks +name: TrustyAI Python benchmarks (merge) on: push: branches: - - 'main' - pull_request: + - main + permissions: contents: write @@ -14,6 +14,7 @@ permissions: jobs: benchmark: + if: github.event.pull_request.merged == 'true' name: Run pytest-benchmark benchmark runs-on: ubuntu-latest steps: @@ -28,11 +29,13 @@ jobs: check-latest: true - uses: stCarolas/setup-maven@v4 with: - maven-version: 3.5.4 - - name: Install dependencies + maven-version: 3.8.1 + - name: Build explainability-core + uses: ./.github/actions/build-core + - name: Build arrow-converter + uses: ./.github/actions/build-arrow + - name: Install TrustyAI Python package run: | - python -m pip install --upgrade pip - pip install -r requirements.txt pip install -r requirements-dev.txt pip install . - name: Run benchmark diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 0a5ad6c..1510ff5 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -1,11 +1,9 @@ -name: TrustyAI Python benchmarks +name: TrustyAI Python benchmarks (PR) on: - push: - branches: - - '*' - - '!main' pull_request: + branches: + - main permissions: contents: write @@ -29,27 +27,24 @@ jobs: check-latest: true - uses: stCarolas/setup-maven@v4 with: - maven-version: 3.5.4 - - name: Install dependencies + maven-version: 3.8.1 + - name: Build explainability-core + uses: ./.github/actions/build-core + - name: Build arrow-converter + uses: ./.github/actions/build-arrow + - name: Install TrustyAI Python package run: | - python -m pip install --upgrade pip - pip install -r requirements.txt pip install -r requirements-dev.txt pip install . - name: Run benchmark run: | pytest tests/benchmarks/benchmark.py --benchmark-json tests/benchmarks/results.json - - name: Store benchmark result + - name: Benchmark result comment uses: benchmark-action/github-action-benchmark@v1 with: name: TrustyAI continuous benchmarks tool: 'pytest' - output-file-path: tests/benchmarks/results.json - github-token: ${{ secrets.GITHUB_TOKEN }} auto-push: false - alert-threshold: '200%' - comment-on-alert: true comment-always: true fail-on-alert: false - save-data-file: false - alert-comment-cc-users: '@ruivieira' \ No newline at end of file + alert-comment-cc-users: '@ruivieira'