From 3b137bded7647d5af3d40c2f7ef2c6929fc2bb3c Mon Sep 17 00:00:00 2001 From: Alek Petuskey Date: Sun, 19 Jan 2025 18:29:32 -0800 Subject: [PATCH] Test codespeed --- .github/workflows/codspeed.yml | 28 --------------------- .github/workflows/unit_tests.yml | 42 ++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/codspeed.yml diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml deleted file mode 100644 index a1b63e2bc..000000000 --- a/.github/workflows/codspeed.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: CodSpeed - -on: - push: - branches: - - "main" # or "master" - pull_request: - # `workflow_dispatch` allows CodSpeed to trigger backtest - # performance analysis in order to generate initial data. - workflow_dispatch: - -jobs: - benchmarks: - name: Run benchmarks - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup_build_env - with: - python-version: "3.12" - run-poetry-install: true - create-venv-at-path: .venv - - - name: Run benchmarks - uses: CodSpeedHQ/action@v3 - with: - token: ${{ secrets.CODSPEED_TOKEN }} - run: poetry run pytest tests/ --codspeed \ No newline at end of file diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index e0a3723ac..aca0e82a9 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -68,21 +68,30 @@ jobs: run-poetry-install: true create-venv-at-path: .venv - name: Run unit tests - run: | - export PYTHONUNBUFFERED=1 - poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= + uses: CodSpeedHQ/action@v3 + with: + token: ${{ secrets.CODSPEED_TOKEN }} + run: | + export PYTHONUNBUFFERED=1 + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= --codspeed - name: Run unit tests w/ redis if: ${{ matrix.os == 'ubuntu-latest' }} - run: | - export PYTHONUNBUFFERED=1 - export REDIS_URL=redis://localhost:6379 - poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= + uses: CodSpeedHQ/action@v3 + with: + token: ${{ secrets.CODSPEED_TOKEN }} + run: | + export PYTHONUNBUFFERED=1 + export REDIS_URL=redis://localhost:6379 + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= --codspeed # Change to explicitly install v1 when reflex-hosting-cli is compatible with v2 - name: Run unit tests w/ pydantic v1 - run: | - export PYTHONUNBUFFERED=1 - poetry run uv pip install "pydantic~=1.10" - poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= + uses: CodSpeedHQ/action@v3 + with: + token: ${{ secrets.CODSPEED_TOKEN }} + run: | + export PYTHONUNBUFFERED=1 + poetry run uv pip install "pydantic~=1.10" + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= --codspeed - name: Generate coverage report run: poetry run coverage html @@ -107,7 +116,10 @@ jobs: export PYTHONUNBUFFERED=1 poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= - name: Run unit tests w/ pydantic v1 - run: | - export PYTHONUNBUFFERED=1 - poetry run uv pip install "pydantic~=1.10" - poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= + uses: CodSpeedHQ/action@v3 + with: + token: ${{ secrets.CODSPEED_TOKEN }} + run: | + export PYTHONUNBUFFERED=1 + poetry run uv pip install "pydantic~=1.10" + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report=