Skip to content
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
42 changes: 28 additions & 14 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,32 @@ on:

jobs:
test:
uses: fredshone/actions/.github/workflows/python-install-lint-test.yml@main
with:
os: ubuntu-latest
py3version: "11"
notebook_kernel: caveat
lint: false
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4

# aws-upload:
# needs: test
# if: needs.test.result == 'success'
# uses: fredshone/actions/.github/workflows/aws-upload.yml@main
# secrets:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_S3_CODE_BUCKET: ${{ secrets.AWS_S3_CODE_BUCKET }}
- uses: mamba-org/setup-micromamba@v2
with:
environment-name: caveat
create-args: >-
python=3.11
-c conda-forge -c pytorch -c nvidia -c city-modelling-lab
--file=requirements/base.txt
--file=requirements/dev.txt
cache-environment: true
post-cleanup: none

- name: Install PyPI dependencies
run: pip install -r requirements/pip.txt

- name: Install package
run: pip install --no-deps -e .

- name: Install kernel
run: python -m ipykernel install --user --name caveat

- name: Run tests
run: pytest
35 changes: 0 additions & 35 deletions .github/workflows/daily-scheduled-ci.yml

This file was deleted.

75 changes: 66 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,73 @@ on:
jobs:
docs-test:
if: github.ref != 'refs/heads/main'
uses: fredshone/actions/.github/workflows/docs-deploy.yml@main
with:
deploy_type: test
notebook_kernel: caveat
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v2
with:
environment-name: caveat
create-args: >-
python=3.11
-c conda-forge -c pytorch -c nvidia -c city-modelling-lab
--file=requirements/base.txt
--file=requirements/dev.txt
cache-environment: true
post-cleanup: none

- name: Install PyPI dependencies
run: pip install -r requirements/pip.txt

- name: Install package
run: pip install --no-deps -e .

- name: Install kernel
run: python -m ipykernel install --user --name caveat

- name: Test docs build
run: mkdocs build --strict

docs-update-latest:
if: github.ref == 'refs/heads/main'
permissions:
contents: write
if: github.ref == 'refs/heads/main'
uses: fredshone/actions/.github/workflows/docs-deploy.yml@main
with:
deploy_type: update_latest
notebook_kernel: caveat
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: mamba-org/setup-micromamba@v2
with:
environment-name: caveat
create-args: >-
python=3.11
-c conda-forge -c pytorch -c nvidia -c city-modelling-lab
--file=requirements/base.txt
--file=requirements/dev.txt
cache-environment: true
post-cleanup: none

- name: Install PyPI dependencies
run: pip install -r requirements/pip.txt

- name: Install package
run: pip install --no-deps -e .

- name: Install kernel
run: python -m ipykernel install --user --name caveat

- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Deploy latest docs
run: mike deploy --push --update-aliases develop latest
92 changes: 63 additions & 29 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,69 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
py3version: ["9", "11"]
py3version: ["11"]
fail-fast: false
uses: fredshone/actions/.github/workflows/python-install-lint-test.yml@main
with:
os: ${{ matrix.os }}
py3version: ${{ matrix.py3version }}
notebook_kernel: caveat
lint: false
pytest_args: '--no-cov' # ignore coverage
upload_to_codecov: false
additional_mamba_args: '-c conda-forge -c pytorch -c nvidia'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v2
with:
environment-name: caveat
create-args: >-
python=3.${{ matrix.py3version }}
-c conda-forge -c pytorch -c nvidia -c city-modelling-lab
--file=requirements/base.txt
--file=requirements/dev.txt
cache-environment: true
post-cleanup: none

- name: Install PyPI dependencies
run: pip install -r requirements/pip.txt

- name: Install package
run: pip install --no-deps -e .

- name: Install kernel
run: python -m ipykernel install --user --name caveat

- name: Run tests
run: pytest --no-cov

test-coverage:
uses: fredshone/actions/.github/workflows/python-install-lint-test.yml@main
with:
os: ubuntu-latest
py3version: "11"
notebook_kernel: caveat
lint: false
pytest_args: 'tests/' # ignore example notebooks
upload_to_codecov: true
additional_mamba_args: '-c conda-forge -c pytorch -c nvidia'

# memory-profile:
# uses: fredshone/actions/.github/workflows/python-memory-profile.yml@main
# with:
# py3version: "11"
# upload_flamegraph: true
# additional_mamba_args: '-c conda-forge -c pytorch -c nvidia'

# cruft-check:
# uses: fredshone/actions/.github/workflows/template-check.yml@main
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v2
with:
environment-name: caveat
create-args: >-
python=3.11
-c conda-forge -c pytorch -c nvidia -c city-modelling-lab
--file=requirements/base.txt
--file=requirements/dev.txt
cache-environment: true
post-cleanup: none

- name: Install PyPI dependencies
run: pip install -r requirements/pip.txt

- name: Install package
run: pip install --no-deps -e .

- name: Install kernel
run: python -m ipykernel install --user --name caveat

- name: Run tests with coverage
run: pytest tests/

- uses: codecov/codecov-action@v4
with:
file: reports/coverage/coverage.xml
35 changes: 30 additions & 5 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,33 @@ on:

jobs:
conda-build:
uses: fredshone/actions/.github/workflows/conda-build.yml@main
secrets:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
with:
package_name: caveat
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v2
with:
environment-name: build
create-args: >-
python=3.11
boa
conda-verify
-c conda-forge -c city-modelling-lab
cache-environment: true
post-cleanup: none

- name: Build conda package
run: |
VERSION=${GITHUB_REF_NAME#v}
conda mambabuild conda.recipe/ --no-anaconda-upload \
-c conda-forge -c city-modelling-lab \
--output-folder ./conda-bld

- uses: actions/upload-artifact@v4
with:
name: conda-package-${{ github.ref_name }}
path: conda-bld/**/*.tar.bz2
retention-days: 3
80 changes: 70 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,77 @@ on:

jobs:
conda-upload:
uses: fredshone/actions/.github/workflows/conda-upload.yml@main
secrets:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
with:
package_name: caveat
build_workflow: pre-release.yml
runs-on: ubuntu-latest
environment: release
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v2
with:
environment-name: publish
create-args: >-
python=3.11
anaconda-client
-c conda-forge
cache-environment: true
post-cleanup: none

- name: Download build artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: pre-release.yml
name: conda-package-${{ github.ref_name }}
path: conda-bld/

- name: Upload to Anaconda
run: |
VERSION=${GITHUB_REF_NAME#v}
anaconda --token ${{ secrets.ANACONDA_TOKEN }} upload \
--user city-modelling-lab \
conda-bld/**/*.tar.bz2

docs-stable:
permissions:
contents: write
uses: fredshone/actions/.github/workflows/docs-deploy.yml@main
with:
deploy_type: update_stable
notebook_kernel: caveat
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: mamba-org/setup-micromamba@v2
with:
environment-name: caveat
create-args: >-
python=3.11
-c conda-forge -c pytorch -c nvidia -c city-modelling-lab
--file=requirements/base.txt
--file=requirements/dev.txt
cache-environment: true
post-cleanup: none

- name: Install PyPI dependencies
run: pip install -r requirements/pip.txt

- name: Install package
run: pip install --no-deps -e .

- name: Install kernel
run: python -m ipykernel install --user --name caveat

- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Deploy stable docs
run: |
VERSION=${GITHUB_REF_NAME#v}
mike deploy --push --update-aliases $VERSION stable
mike set-default --push stable
Loading
Loading