pytesting #20
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: Build Prod and PyTest | |
on: | |
pull_request: | |
branches: | |
- main | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Docker image | |
run: docker build -t prod -f .deployment/prod.Dockerfile . | |
- name: Create Docker container with pytest.ini | |
run: | | |
docker create --name temp_container prod | |
docker cp pytest.ini temp_container:/ | |
docker commit temp_container prod:with_pytest_ini | |
- name: Run tests (override entrypoint to run tests rather than deploy) | |
run: | | |
docker run \ | |
--entrypoint /bin/bash \ | |
-v ${{ github.workspace }}/tests:/tests \ | |
prod:with_pytest_ini \ | |
-c "conda run -n burn-severity-prod pytest -svv /tests" |