Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish codecov step #377

Merged
merged 4 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .ci/310.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ dependencies:
- contextily
- scikit-plot
- python-graphviz
- sphinx>=1.4.3
- sphinxcontrib-bibtex==1
- sphinx_bootstrap_theme
- numpydoc
67 changes: 33 additions & 34 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
name: Build Docs

on:
push:
branches:
- master
- main
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
inputs:
version:
description: Manual Doc Build
default: test
required: false
jobs:
docs:
name: CI (${{ matrix.os }}-${{ matrix.environment-file }})
name: build & push docs
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 20
timeout-minutes: 90
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [.ci/39.yml]
environment-file: [.ci/310.yml]
experimental: [false]
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
env:
CACHE_NUMBER: 0
- name: checkout repo
uses: actions/checkout@v3

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
path: ~/conda_pkgs_dir
key: ${{ matrix.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(matrix.environment-file) }}
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 'latest'
channels: conda-forge
channel-priority: true
auto-update-conda: true
auto-activate-base: false
environment-file: ${{ matrix.environment-file }}
activate-environment: test
use-only-tar-bz2: true
- run: conda info --all
- run: conda list
- run: conda config --show-sources
- run: conda config --show
- run: pip install -e . --no-deps --force-reinstall
- run: cd docs; make html
- name: Commit documentation changes
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'

- name: make docs
run: |
pip install -e . --no-deps --force-reinstall
cd docs; make html

- name: commit docs
run: |
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
Expand All @@ -51,12 +49,13 @@
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.
- name: Push changes
# The above command will fail if no changes were present,
# so we ignore the return code.

- name: push to gh-pages
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
force: true
15 changes: 12 additions & 3 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,20 @@ jobs:

- name: Test geosnap
run: |
pytest -v --color yes --cov=geosnap --cov-append --cov-report term-missing --cov-report xml .

coverage run -m pytest -v --color yes --cov=geosnap --cov-append --cov-report term-missing --cov-report xml .
- name: codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
name: geosnap-codecov
name: geosnap-codecov

- name: Generate and publish the report
if: |
failure()
&& steps.status.outcome == 'failure'
&& github.event_name == 'schedule'
&& github.repository_owner == 'oturns'
uses: xarray-contrib/issue-from-pytest-log@v1
with:
log-path: pytest-log.jsonl
Loading