Skip to content

Update test session information #3

Update test session information

Update test session information #3

Workflow file for this run

name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Create Python virtual environment
run: python -m venv .venv
- name: Install Python dependencies
run: |
source .venv/bin/activate
python -m pip install --upgrade pip
pip install synergy-dataset asreview-datatools pytest pytest-benchmark maturin
- name: Package and Install with Maturin
run: |
source .venv/bin/activate
maturin develop --release
- name: Run synergy get
run: |
source .venv/bin/activate
synergy get -d Appenzeller-Herzog_2019 Brouwer_2019 -l -o benches/files
- name: Convert data
run: |
source .venv/bin/activate
asreview data convert ./benches/files/Appenzeller-Herzog_2019.csv ./benches/files/Appenzeller-Herzog_2019.ris
asreview data convert ./benches/files/Brouwer_2019.csv ./benches/files/Brouwer_2019.ris
ls -l ./benches/files
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
- name: Prepare benchmark results file with system info
run: |
echo "============================= Test Session Info ==============================" | tee benches/results.txt
echo "System Information:" | tee -a benches/results.txt
echo "Number of Cores: $(nproc)" | tee -a benches/results.txt
echo "CPU Model: $(lscpu | grep "Model name" | cut -d ':' -f 2 | xargs)" | tee -a benches/results.txt
echo "Memory Information:" | tee -a benches/results.txt
free -h | tee -a benches/results.txt
echo " "
- name: Run Rust benchmarks and write results
run: |
echo "============================== Rust Benchmarks ===============================" | tee -a benches/results.txt
cargo bench | tee -a benches/results.txt
- name: Run Python benchmarks and append results
run: |
source .venv/bin/activate
pytest --benchmark-min-rounds=10 benches/python_bench.py | tee -a benches/results.txt
- name: Commit results to repository
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add benches/results.txt
git commit -m "Update benchmark results"
git push