Skip to content

Commit

Permalink
Merge pull request #1246 from gboeing/actions
Browse files Browse the repository at this point in the history
update workflows
  • Loading branch information
gboeing authored Dec 8, 2024
2 parents d20ef1c + aeb8aae commit c08c559
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Build and publish Docker image
on:
push:
tags:
- 'v*'
- '*'
schedule:
- cron: "0 8 * * 1" # every monday at 08:00 UTC
- cron: "30 6 * * 1" # every monday at 06:30 UTC
workflow_dispatch:

jobs:
build_push_docker_image:
build_publish_docker:
if: ${{ github.repository == 'gboeing/osmnx' }}
name: Build/push image to Docker Hub
name: Build/publish image to Docker Hub
runs-on: ubuntu-latest

steps:
Expand All @@ -21,22 +21,21 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
username: gboeing
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}
flavor: latest=auto
images: gboeing/osmnx

- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
file: ./environments/docker/Dockerfile
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/build-publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and publish to PyPI

on:
push:
tags:
- 'v*'
schedule:
- cron: "0 6 * * 1" # every monday at 06:00 UTC
workflow_dispatch:

jobs:
build_publish_pypi:
if: ${{ github.repository == 'gboeing/osmnx' }}
name: Build/publish package to PyPI
runs-on: ubuntu-latest

defaults:
run:
shell: bash -elo pipefail {0}

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build and check package
run: |
python -m pip install --user hatch twine validate-pyproject[all]
python -m validate_pyproject ./pyproject.toml
python -m hatch build --clean
python -m twine check --strict ./dist/*
- name: Publish package to PyPI
if: ${{ github.event_name != 'schedule' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
print-hash: true
verbose: true
verify-metadata: true
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [main, v1]
schedule:
- cron: "0 5 * * 1" # every monday at 05:00 UTC
- cron: "0 4 * * 1" # every monday at 04:00 UTC
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -38,6 +38,7 @@ jobs:
- name: Install OSMnx
run: |
python -m pip install -e .
python -m pip check
micromamba list
python -m pip show osmnx
Expand Down
46 changes: 0 additions & 46 deletions .github/workflows/publish-pypi.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
name: Build and check package/docs
name: Build docs and check links

on:
schedule:
- cron: "0 6 * * 1" # every monday at 06:00 UTC
- cron: "30 4 * * 1" # every monday at 04:30 UTC
workflow_dispatch:

jobs:
test_build:
test_docs_linkcheck:
if: ${{ github.repository == 'gboeing/osmnx' }}
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
name: Build docs and check links
runs-on: ubuntu-latest

defaults:
run:
Expand All @@ -27,16 +23,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"

- name: Install requirements
run: python -m pip install -r ./environments/tests/requirements-test-build.txt

- name: Build and validate package
run: |
validate-pyproject ./pyproject.toml
hatch build --clean
twine check --strict ./dist/*
python -m pip install --user furo "sphinx==7.*" sphinx-autodoc-typehints
python -m pip check
- name: Build docs and check links
run: python -m sphinx -E -W --keep-going -b linkcheck ./docs/source ./docs/build/linkcheck
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Test latest/pre-release dependency versions

on:
schedule:
- cron: "0 7 * * 1" # every monday at 07:00 UTC
- cron: "30 5 * * 1" # every monday at 05:30 UTC
workflow_dispatch:

jobs:
test_latest:
test_latest_deps:
if: ${{ github.repository == 'gboeing/osmnx' }}
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -26,13 +26,13 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: "pip"
python-version: "3.x"

- name: Install OSMnx with dependency pre-releases
- name: Install OSMnx with latest/pre-release dependencies
run: |
python -m pip install --pre -r ./environments/tests/requirements-test-latest.txt
python -m pip install --pre -r ./environments/tests/requirements-test-latest-deps.txt
python -m pip install -e .
python -m pip check
python -m pip list -v
python -m pip show osmnx
python --version
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Test minimal versions
name: Test minimum dependency versions

on:
schedule:
- cron: "0 4 * * 1" # every monday at 04:00 UTC
- cron: "0 5 * * 1" # every monday at 05:00 UTC
workflow_dispatch:

jobs:
test_minimal:
test_minimum_deps:
if: ${{ github.repository == 'gboeing/osmnx' }}
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -23,16 +23,17 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Create environment with Micromamba
- name: Create environment with minimum dependency versions
uses: mamba-org/setup-micromamba@v2
with:
cache-environment: true
environment-file: ./environments/tests/env-test-minimal.yml
environment-file: ./environments/tests/env-test-minimum-deps.yml
post-cleanup: none

- name: Install OSMnx
run: |
python -m pip install -e .
python -m pip check
micromamba list
python -m pip show osmnx
Expand Down
3 changes: 2 additions & 1 deletion environments/docker/docker-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
set -e
#docker image prune -af && docker system prune -af && docker volume prune -af && docker system df
docker login
docker buildx build --no-cache --pull --load --platform=linux/arm64 -f environments/docker/Dockerfile -t gboeing/osmnx:test .
docker buildx build --no-cache --pull --push --platform=linux/amd64,linux/arm64 -f ./environments/docker/Dockerfile -t gboeing/osmnx:test .
IMPORTED_VERSION=$(docker run --rm gboeing/osmnx:test /bin/bash -c "ipython -c \"import osmnx; print(osmnx.__version__)\"")
echo "Imported $IMPORTED_VERSION"
File renamed without changes.
6 changes: 0 additions & 6 deletions environments/tests/requirements-test-build.txt

This file was deleted.

2 changes: 1 addition & 1 deletion osmnx/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""OSMnx package version information."""

__version__ = "2.0.0"
__version__ = "2.0.1dev"

0 comments on commit c08c559

Please sign in to comment.