Skip to content

Merge pull request #16 from lrvl/main #38

Merge pull request #16 from lrvl/main

Merge pull request #16 from lrvl/main #38

Workflow file for this run

name: Run all speed tests
"on":
push:
pull_request:
jobs:
python-speed-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
name: Speedtest Python ${{ matrix.python-version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run Python test
run: cd pi_estimates/Python && ./run.sh > speedtest_python_${{ matrix.python-version }}.out
- uses: actions/upload-artifact@v3
with:
name: speedtest_outputs
path: pi_estimates/Python/speedtest_python_${{ matrix.python-version }}.out
c-speed-test:
runs-on: ubuntu-latest
name: Speedtest C++
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Compile and run C version
run: cd pi_estimates/C && ./run.sh > speedtest_c.out
- uses: actions/upload-artifact@v3
with:
name: speedtest_outputs
path: pi_estimates/C/speedtest_c.out
cpp-speed-test:
runs-on: ubuntu-latest
name: Speedtest C++ (improved version)
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Compile and run C version
run: cd pi_estimates/Cpp && ./run.sh > speedtest_cpp.out
- uses: actions/upload-artifact@v3
with:
name: speedtest_outputs
path: pi_estimates/Cpp/speedtest_cpp.out
go-speed-test:
runs-on: ubuntu-latest
name: Speedtest Go
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: '^1.19.5'
- name: Compile and run Go version
run: cd pi_estimates/Go && ./run.sh > speedtest_go.out
- uses: actions/upload-artifact@v3
with:
name: speedtest_outputs
path: pi_estimates/Go/speedtest_go.out
julia-speed-test:
runs-on: ubuntu-latest
name: Speedtest Julia
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Julia environment
uses: julia-actions/setup-julia@v1
with:
version: 1.8.5
- name: Run Julia version
run: cd pi_estimates/Julia && ./run.sh > speedtest_julia.out
- uses: actions/upload-artifact@v3
with:
name: speedtest_outputs
path: pi_estimates/Julia/speedtest_julia.out
rust-speed-test:
runs-on: ubuntu-latest
name: Speedtest Rust
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust environment
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Compile Rust version
run: cd pi_estimates/Rust && cargo build --release
- name: Run Rust version
run: cd pi_estimates/Rust && ./target/release/pi_estimate > speedtest_rust.out
- uses: actions/upload-artifact@v3
with:
name: speedtest_outputs
path: pi_estimates/Rust/speedtest_rust.out
cython-numba-speed-test:
runs-on: ubuntu-latest
name: Speedtest Cython and Numba
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Cython & Numba packages
run: cd pi_estimates/Cython_and_Numba && pip install -r requirements.txt
- name: Run Numba version
run: cd pi_estimates/Cython_and_Numba && ./run_numba.sh > speedtest_numba.out
- name: Run Cython version
run: cd pi_estimates/Cython_and_Numba && ./run_cython.sh > speedtest_cython.out
- uses: actions/upload-artifact@v3
with:
name: speedtest_outputs
path: pi_estimates/Cython_and_Numba/speedtest_*.out
data-collector:
needs: [python-speed-tests, c-speed-test, go-speed-test, julia-speed-test, rust-speed-test, cython-numba-speed-test, cpp-speed-test]
runs-on: ubuntu-latest
name: Speedtest data collector
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create temp folder
run: mkdir speedtest_data
- name: Download speedtest data
uses: actions/download-artifact@v3
with:
name: speedtest_outputs
path: speedtest_data
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Combine data
run: python scripts/results_analyzer.py --speedtest-data-path speedtest_data/
- uses: actions/upload-artifact@v3
with:
name: speedtest_results
path: speedtest_data/speedtest_results.json