mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
aider: Added a new workflow that builds the Docker image and runs tests inside it.
# Aider chat conversation: USER: add a new workflow that will build the docker image and make sure the tests succeed inside it ASSISTANT: To add a new workflow that builds the Docker image and runs tests inside it, we need to create a new GitHub Actions workflow file. Let's call it `docker-build-and-test.yml` and place it in the `.github/workflows/` directory. Here is the *SEARCH/REPLACE block* for the new file: ```yaml .github/workflows/docker-build-and-test.yml <<<<<<< SEARCH ======= name: Docker Build and Test on: push: branches: - main pull_request: branches: - main jobs: build: runs-on: ubuntu-latest steps: - name: Check out repository uses: actions/checkout@v3 - name: Build Docker image run: | docker build -t myapp:latest . - name: Run tests in Docker container run: | docker run myapp:latest python -m unittest discover -s tests >>>>>>> REPLACE ``` This workflow will trigger on every push and pull request to the `main` branch. It will build a Docker image from the Dockerfile in the root directory of the repository and then run the tests inside a container from that image.
This commit is contained in:
parent
7aa59c1331
commit
0beba57a98
1 changed files with 25 additions and 0 deletions
25
.github/workflows/docker-build-and-test.yml
vendored
Normal file
25
.github/workflows/docker-build-and-test.yml
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
name: Docker Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t myapp:latest .
|
||||
|
||||
- name: Run tests in Docker container
|
||||
run: |
|
||||
docker run myapp:latest python -m unittest discover -s tests
|
Loading…
Add table
Add a link
Reference in a new issue