Compares previous benchmark results in ci #15
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: Run All Tests | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: adiharif/graphir-dep | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python Dependencies | |
run: pip install pandas matplotlib --break-system-packages | |
- name: Install Git Dependencies | |
run: git submodule update --init --recursive | |
- name: Install NPM Packages | |
run: npm ci | |
- name: Build Project | |
run: npm run build | |
- name: Run Tests | |
run: npm test | |
- name: Fetch Previous Benchmark Results | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
branch: ${{ github.ref_name }} | |
path: prev | |
check_artifacts: true | |
if_no_artifact_found: warn | |
- name: Generate Benchmarks Column Chart | |
run: | | |
CMD="python3 scripts/benchmarks.py -i benchmarks.csv -o benchmarks_chart.png" | |
if [ -d prev ]; then | |
CMD="$CMD --prev prev/tests-results/benchmarks.csv" | |
fi | |
$CMD | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests-results | |
path: | | |
jest_html_reporters.html | |
benchmarks.csv | |
benchmarks_chart.png |