some changes to ensure Python unittests are executed #16
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: Docker Build and Test | |
on: [push, pull_request] | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Docker Environment | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Docker image | |
run: docker build . -t meloian/modern_prog:latest | |
- name: Log in to Docker Registry | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push to Docker Registry | |
run: docker push meloian/modern_prog:latest | |
- name: Pull and Run Docker container | |
run: docker run --rm meloian/modern_prog:latest | |
- name: Execute Tests | |
run: docker run --rm meloian/modern_prog:latest python3 -m unittest discover -s /app -p 'test_*.py' | |
- name: List files in /app directory | |
run: docker run --rm meloian/modern_prog:latest ls -R /app |