Merge pull request #28 from statisticsnorway/dev_url_fix #52
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
# .github/workflows/app.yaml | |
name: PyTest | |
on: | |
push: | |
branches: [main, master] | |
pull_request: | |
branches: [main, master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
python-version: ["3.10.9"] | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip and setuptools | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools | |
- name: Install system dependencies | |
run: | | |
# Install system-level dependencies (Linux example) | |
sudo apt-get update | |
sudo apt-get install -y build-essential python3-dev | |
- name: Create virtual environment | |
run: python -m venv venv | |
- name: Activate virtual environment | |
run: | | |
source venv/bin/activate | |
- name: Install dependencies | |
run: pip install -r python/requirements.txt | |
- name: Run unit tests | |
run: python -m unittest discover -s python/tests -p '*_test.py' | |
- name: Install coverage package | |
run: pip install coverage | |
- name: Generate Coverage Report | |
run: | | |
coverage run -m unittest discover -s python/tests -p '*_test.py' | |
coverage report -m |