File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ jobs:
1111 runs-on : ubuntu-latest
1212 steps :
1313 - uses : actions/checkout@v3
14- - uses : actions/setup-python@v3
15- with :
16- python-version : ' 3.10'
17- - run : pip install -r requirements.txt
14+ - name : Launch app in docker compose
15+ run : |
16+ docker compose up -d app
17+ - name : Run CodSpeed inside docker compose
18+ run : |
19+ # create .env file with the content of the `env` command
20+ env > .env
1821
19- - uses : CodSpeedHQ/action@feat/tokenless-upload
20- with :
21- upload_url : https://api.staging.preview.codspeed.io/upload
22- run : pytest tests/ --codspeed
22+ # pass the .env file to the docker compose exec command and run the benchmarks
23+ docker compose --env-file .env exec app sh -c "codspeed run pytest tests/ --codspeed"
Original file line number Diff line number Diff line change 1+ # Use the official Python image from the Docker Hub
2+ FROM python:3.12
3+
4+ # Set the working directory in the container
5+ WORKDIR /app
6+
7+ # Copy the requirements file into the container
8+ COPY requirements.txt .
9+
10+ # Install the dependencies
11+ RUN pip install -r requirements.txt
12+
13+ # Copy the rest of the application code into the container
14+ COPY . .
15+
16+ # Set the RUNNER_VERSION environment variable
17+ ENV RUNNER_VERSION=3.2.1
18+
19+ # Install the CodSpeed runner
20+ RUN curl -fsSL https://github.com/CodSpeedHQ/runner/releases/download/v$RUNNER_VERSION/codspeed-runner-installer.sh | sh -s && \
21+ . $HOME/.cargo/env
Original file line number Diff line number Diff line change 1+ services :
2+ app :
3+ build : .
4+ volumes :
5+ - .:/app
6+ command : " tail -f /dev/null"
You can’t perform that action at this time.
0 commit comments