Merge pull request #65 from lsst-dm/tickets/DM-46747 #280
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Run PyTest | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
run_pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build docker image | |
run: docker build -f Dockerfile.pytest -t pytest_image . | |
- name: Create directory for coverage report | |
run: mkdir -p ${{ github.workspace }}/pytest_reports | |
- name: Set coverage report directory permissions | |
run: chmod -R 777 ${{ github.workspace }}/pytest_reports | |
- name: Run docker image | |
run: docker run --rm -v ${{ github.workspace }}/pytest_reports:/home/lsst/consdb/pytest_reports -e PYTEST_ADDOPTS="--color=yes" pytest_image | |
- name: Upload test report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pytest_report | |
path: pytest_reports/pytest_report.html | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_report | |
path: pytest_reports/htmlcov |