Skip to content

Merge dev into main #2229

Merge dev into main

Merge dev into main #2229

Workflow file for this run

name: Build and deploy manual
on:
pull_request:
branches: [main, dev]
release:
types: [created]
jobs:
builddocs:
name: Build manual
runs-on: ubuntu-20.04
strategy:
matrix:
compiler: [gcc]
python-version: ["3.10"]
rust: [1.62.1]
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Set up rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Install cbindgen
uses: baptiste0928/cargo-install@v2
with:
crate: cbindgen
version: "=0.24.3"
# We install the R dependencies first
# Later, Python dependencies will go into the same place.
# Python will silently update dependencies if needed,
# and they'll get cached, too.
- name: Cache dependancies
id: cache
uses: actions/cache@v3
with:
path: |
~/.local
key: ${{ matrix.python }}-${{ hashFiles('doc/development.txt') }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install apt dependencies
run: |
sudo apt install --fix-missing -y libgsl-dev cmake
- name: Set GCC as compiler
if: matrix.compiler == 'gcc'
run: |
echo "CC=gcc-9" >> $GITHUB_ENV
echo "CXX=g++-9" >> $GITHUB_ENV
- name: Test compiler
if: matrix.compiler == 'gcc'
run: |
$CXX -v
$CC -v
- name: Edit PATH
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Python dependencies
run: |
python -m pip install --user --upgrade pip
# These are needed to install black:
python -m pip install --user --upgrade setuptools wheel
python -m pip install --user --upgrade -r requirements/development.txt
- name: rustc version
run: |
rustc --version
- name: cbindgen version
run: |
cbindgen --version
- name: Build module
run: |
python -m pip install -e .
- name: Build the docs
working-directory: doc
run: |
make
- name: Move built HTML docs
if: github.event_name == 'release'
working-directory: doc
run: |
mv _build/html ../docs_output
- name: Upload artifacts
if: github.event_name == 'release'
uses: actions/upload-artifact@v3
with:
name: docs_output
path: docs_output/
deploy:
name: deploy
needs: builddocs
if: github.event_name == 'release'
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3.0.2
with:
# Artifact name
name: docs_output # optional
# Destination path
path: docs_output # optional
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS }}
with:
build_dir: docs_output/