Merge pull request #394 from GermanZero-de/year_baseline #371
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ "ubuntu-latest" ] | |
defaults: | |
run: | |
shell: bash | |
runs-on: ${{ matrix.os }} | |
env: | |
# Required coverage | |
COVERAGE_REQ: 98 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-root | |
- name: Install library | |
run: poetry install --no-interaction | |
- name: Checkout data repositories | |
env: | |
PA_TOKEN: ${{ secrets.LZ_PAT }} | |
run: | | |
source $VENV | |
poetry run python devtool.py data checkout -pat ${PA_TOKEN} | |
shell: bash | |
- name: Run pytest | |
run: | | |
source $VENV | |
poetry run pytest tests/ | |
- name: Run pytest coverage | |
run: | | |
source $VENV | |
poetry run pytest --cov=src/climatevision/ tests/ --cov-fail-under=${{ env.COVERAGE_REQ }} |