Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.10'
- run: pip install -r requirements.txt

- uses: CodSpeedHQ/action@feat/tokenless-upload
with:
upload_url: https://api.staging.preview.codspeed.io/upload
run: pytest tests/ --codspeed
- name: Run CodSpeed in docker
run: |
# create .env file with the content of the `env` command
env > .env
# build the image
docker buildx build . -t python-image
# run the container with a long running command, in privileged mode and bind the event.json file
docker run -d --privileged --name python -v /home/runner/work/_temp/_github_workflow/event.json:/home/runner/work/_temp/_github_workflow/event.json python-image tail -f /dev/null
# run codspeed in the container
docker exec --env-file .env python sh -c "/root/.cargo/bin/codspeed run -- pytest tests/ --codspeed"
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use the official Python image from the Docker Hub
FROM python:3.12

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container
COPY requirements.txt .

# Install the dependencies
RUN pip install -r requirements.txt

# Copy the rest of the application code into the container
COPY --chown=root:root . .

# Set the RUNNER_VERSION environment variable
ENV RUNNER_VERSION=3.2.1

# Install the CodSpeed runner
RUN curl -fsSL https://github.com/CodSpeedHQ/runner/releases/download/v$RUNNER_VERSION/codspeed-runner-installer.sh | sh -s
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest~=7.1.3
pytest-benchmark~=3.4.1
pytest-codspeed~=1.1.0
pytest-codspeed~=3.1.0
Loading