Skip to content

[pre-commit.ci] pre-commit autoupdate #464

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #464

Workflow file for this run

name: ci-build
on:
pull_request:
branches:
- master
jobs:
# lint is handled by pre-commit ci conf
generate-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install requirements
run: pip install -r requirements.txt
- name: Install icclim
run: python -m pip install -e .
- name: install black
run: pip install black
- name: call fun extractor
run: python ./tools/extract-icclim-funs.py icclim/_generated_api.py
- name: run black on generated module
run: black icclim/_generated_api.py
- name: create local ref
run: |
git fetch origin ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
- name: setup git config
run: |
# setup the username and email.
git config user.name "GitHub Actions Bot - API updater"
git config user.email "<>"
- name: commit
run: |
# Stage the file, commit and push
git add icclim/_generated_api.py
# Ignore error cases
git commit -m "MAINT: Update generated API" || true
git push origin ${{ github.head_ref }}
test:
runs-on: ubuntu-latest
steps:
# actions/checkout@v2 checkouts to a new merge commit
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install requirements
run: pip install -r requirements.txt
- name: Install pytest-cov
run: pip install pytest-cov
- name: Install icclim
run: python -m pip install -e .
- name: Build coverage file
run: |
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=icclim icclim/tests | tee pytest-coverage.txt; ( exit ${PIPESTATUS[0]} )
- name: Pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
title: Report
badge-title: Coverage
hide-badge: false
hide-report: false
create-new-comment: false
hide-comment: false
report-only-changed-files: false
junitxml-path: ./pytest.xml
junitxml-title: Test results
- name: create local ref
run: |
git fetch origin ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
- name: Update Readme with Coverage Html
run: |
sed -i '/ Pytest Coverage Comment:Begin/,/ Pytest Coverage Comment:End/c\ Pytest Coverage Comment:Begin\n\n.. |coverage| image:: https://img.shields.io/badge/Coverage-${{ steps.coverageComment.outputs.coverage }}25-${{ steps.coverageComment.outputs.color }}.svg\n :target: https://github.com/cerfacs-globc/icclim/blob/master/README.rst#code-coverage\n :alt: Code coverage\n\n..\n Pytest Coverage Comment:End' ./README.rst
- name: setup git config
run: |
# setup the username and email.
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: commit
run: |
# Stage the file, commit and push
git add README.rst
# Ignore error cases with `|| true`
git commit -m "[skip ci] DOC: Update coverage" || true
git push origin ${{ github.head_ref }}
logo-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install requirements
run: pip install -r requirements.txt
- name: Install pytest-cov
run: pip install pytest-cov
- name: Install icclim
run: python -m pip install -e .
- name: Generate logos
run: |
python ./tools/update_logo_version.py ./doc/source/_static/logo_icclim_colored__base.svg ./doc/source/_static/logo_icclim_colored__displayed.svg
python ./tools/update_logo_version.py ./doc/source/_static/logo_icclim_grey__base.svg ./doc/source/_static/logo_icclim_grey__displayed.svg
python ./tools/update_logo_version.py ./doc/source/_static/logo_icclim_white__base.svg ./doc/source/_static/logo_icclim_white__displayed.svg
- name: create local ref
run: |
git fetch origin ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
- name: setup git config
run: |
# setup the username and email.
git config user.name "GitHub Actions Bot - logo updater"
git config user.email "<>"
- name: commit
run: |
# Stage the file, commit and push
git add doc/source/_static/*__displayed.svg
# Ignore error cases with `|| true`
git commit -m "MAINT: Update logos" || true
git push origin ${{ github.head_ref }}