Fix if all emissions data starts in 2015, in :func:add_year_historical_percentage_offset
#132
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: Climate assessment CI-CD | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
linting-and-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install dev dependencies | |
run: | | |
pip install --upgrade pip wheel | |
pip install -e .[docs,tests,deploy,linter,notebooks] | |
# TODO: add `pylint src` and `pydocstyle src` and docs | |
- name: Formatting and linters | |
run: | | |
black --check src scripts tests setup.py --exclude doc/conf.py | |
black-nb --check notebooks | |
isort --check-only --quiet src scripts tests setup.py doc/conf.py | |
flake8 src scripts tests setup.py doc/conf.py | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install test dependencies | |
run: | | |
pip install --upgrade pip wheel | |
pip install -e .[tests] | |
- name: Test with pytest | |
run: | | |
pytest tests -m "not nightly and not wg3" -r a -vv --cov=climate_assessment --cov-report=xml | |
# ToDo uncomment as soon as package is published - action only runs on PR, workflow_dispatch is not covered | |
# - name: Monitor coverage | |
# if: github.event_name == 'pull_request' | |
# uses: orgoro/coverage@v2 | |
# with: | |
# coverageFile: coverage.xml | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# thresholdAll: 0.78 | |
# thresholdNew: 1 | |
# thresholdModified: 0.78 | |
scripts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip wheel | |
pip install -e . |