Fix docs and tests #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Docs | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
# Install dependencies if not cached | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-ubuntu-latest-docs-${{ hashFiles('**/poetry.lock') }} | |
- if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
name: Install dependencies | |
run: poetry install --no-interaction --with docs | |
# Download default datasets if not cached | |
- name: Get data path | |
run: export DATA_DIR=$(poetry run python -c "import roughness; print(roughness.config.DATA_DIR)") | |
- name: Get data version path | |
run : export FDATA_VERSION=$(poetry run python -c "import roughness; print(roughness.config.FDATA_VERSION)") | |
- name: Load cached datasets | |
id: cached-datasets | |
uses: actions/cache@v3 | |
with: | |
path: ${DATA_DIR} | |
key: datasets-docs-${{ hashFiles('${FDATA_VERSION}') }} | |
restore-keys: | | |
datasets-docs- | |
datasets- | |
- if: steps.cached-datasets.outputs.cache-hit != 'true' | |
name: Download datasets | |
run: poetry run roughness -d | |
- run: poetry run mkdocs gh-deploy --force |