Skip to content

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

[pre-commit.ci] pre-commit autoupdate

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

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
env:
FLIT_ROOT_INSTALL: 1
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install build tools
run: pip install --upgrade pip flit
- name: Install icclim and dev requirements (dev, test and doc)
run: flit install --deps develop
- name: call fun extractor
run: python ./tools/extract_icclim_funs.py
- name: run ruff format on generated module
run: |
ruff format src/icclim/_generated/
ruff check src/icclim/_generated/ --fix
- 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 src/icclim/_generated
# Ignore error cases
git commit -m "MAINT: Update generated API" || true
git push origin ${{ github.head_ref }}
test:
runs-on: ubuntu-latest
env:
FLIT_ROOT_INSTALL: 1
steps:
# actions/checkout@v2 checkouts to a new merge commit
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install build tools
run: pip install --upgrade pip flit
- name: Install icclim and dev requirements (dev, test and doc)
run: flit install --deps develop
- name: Build coverage file
run: pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=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
env:
FLIT_ROOT_INSTALL: 1
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install build tools
run: pip install --upgrade pip flit
- name: Install icclim and dev requirements (dev, test and doc)
run: flit install --deps develop
- 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 }}