Skip to content

test requirement added #45

test requirement added

test requirement added #45

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov
python -m pip install .
- name: Test with pytest
run: pytest --cov=cdsaxs --cov-report=term --cov-report=html --cov-config=pyproject.toml tests/
- name: Archive code coverage results
uses: actions/upload-artifact@v4
if: ${{ matrix.python-version == 3.12 }}
with:
name: code-coverage-report
path: htmlcov/
retention-days: 1
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Choose Python version 3.11'
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- run: sudo apt-get install -y pandoc
- name: install package
run: pip install .
- name: install doc_reqs
run: pip install -r docs_requirements.txt
- name: 'run docs-build'
run: sphinx-build -j auto -b html "docs/source" "docs/build/html"
- uses: actions/upload-pages-artifact@v3.0.1
with:
path: 'docs/build/html/'
deploy-docs:
runs-on: ubuntu-latest
needs: [build-docs, tests]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
repository: CEA-MetroCarac/cdsaxs-doc
ref: refs/heads/main
token: ${{ secrets.CDSAXS_PAGES_ACTIONS_TOKEN }}
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: ${{ runner.temp }}
- name: untar_docs
run: |
mkdir -p ${{ runner.temp }}/github-pages/
tar xf ${{ runner.temp }}/artifact.tar -C ${{ runner.temp }}/github-pages/
cp -r ${{ runner.temp }}/github-pages/* ${{ github.workspace }}
- name: setup git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "actions@github.com"
- name: commit docs
run: |
git status
git add --all
git commit -am "docs update"
git push
- name: cleanup
run: rm -rf *
- uses: actions/checkout@v4
with:
repository: CEA-MetroCarac/CEA-MetroCarac.github.io
ref: refs/heads/main
token: ${{ secrets.CDSAXS_PAGES_ACTIONS_TOKEN }}
submodules: true
- name: Pull & update submodules recursively
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Commit submodule update
run: |
git add --all
git commit -m "Update submodules" || echo "No changes to commit"
git push