Update tests #9
This file contains hidden or 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: CI | |
| on: | |
| pull_request: | |
| branches: [ main, 'emerge/**' ] | |
| push: | |
| branches: [ main, 'emerge/**' ] | |
| jobs: | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| PUFFER_CPU: 1 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Free up disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
| sudo apt-get clean | |
| sudo rm -rf ~/.cache/pip /tmp/* /var/tmp/* | |
| - name: Install pufferlib | |
| env: | |
| TMPDIR: ${{ runner.temp }}/build | |
| PIP_NO_CACHE_DIR: 1 | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y build-essential cmake | |
| python -m pip install -U pip pytest | |
| pip install -e . --no-cache-dir | |
| python setup.py build_ext --inplace --force | |
| - name: Unit tests | |
| run: python -m pytest -v tests/unit_tests | |
| smoke-tests: | |
| name: Smoke Train Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build smoke image | |
| run: docker build -f tests/smoke_tests/Dockerfile -t pufferdrive-smoke . | |
| - name: Smoke golden test | |
| run: docker run --rm pufferdrive-smoke | |
| timeout-minutes: 20 | |
| smoke-replay: | |
| name: Smoke Replay HTML | |
| runs-on: ubuntu-latest | |
| env: | |
| PUFFER_CPU: 1 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Free up disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
| sudo apt-get clean | |
| sudo rm -rf ~/.cache/pip /tmp/* /var/tmp/* | |
| - name: Install pufferlib | |
| env: | |
| TMPDIR: ${{ runner.temp }}/build | |
| PIP_NO_CACHE_DIR: 1 | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y build-essential cmake | |
| python -m pip install -U pip pytest | |
| pip install -e . --no-cache-dir | |
| python setup.py build_ext --inplace --force | |
| - name: Replay HTML test | |
| run: python -m pytest -v tests/smoke_tests/test_validation_replay_html.py | |
| timeout-minutes: 20 | |
| perf-tests: | |
| name: Smoke Performance Test | |
| runs-on: ubuntu-latest | |
| env: | |
| PUFFER_CPU: 1 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Free up disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
| sudo apt-get clean | |
| sudo rm -rf ~/.cache/pip /tmp/* /var/tmp/* | |
| - name: Install pufferlib | |
| env: | |
| TMPDIR: ${{ runner.temp }}/build | |
| PIP_NO_CACHE_DIR: 1 | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y build-essential cmake | |
| python -m pip install -U pip | |
| pip install -e . --no-cache-dir | |
| python setup.py build_ext --inplace --force | |
| - name: Test simulator performance | |
| run: python tests/smoke_tests/test_simulator_perf.py | |
| timeout-minutes: 20 |