docker-env test #1
Workflow file for this run
This file contains 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: Test Docker Environment | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker | |
run: | | |
docker --version | |
docker-compose --version | |
- name: Build Docker image | |
run: | | |
docker build -t my-app . | |
- name: Run Docker container | |
run: | | |
docker run -d --name my-container my-app | |
- name: Run tests inside Docker container | |
run: | | |
docker exec my-container npm test | |
- name: Clean up | |
run: | | |
docker stop my-container | |
docker rm my-container |