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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.venv
.history
__pycache__/
*.pyc
.vscode
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: tests

on:
push:
branches:
- "**"
pull_request:

jobs:
all-tests:
name: Run All Tests
runs-on: ubuntu-latest
env:
COVERAGE_FAIL_UNDER: "80"

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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.14"

- name: Install Poetry
run: pipx install "poetry==2.3.2"

- name: Install dependencies
run: poetry install --no-interaction

- name: Verify package import
run: poetry run python -c "import ott; import ott.osm"

- name: Ensure pytest is available
run: poetry run python -m pip install --upgrade pytest

- name: Ensure coverage is available
run: poetry run python -m pip install --upgrade coverage

- name: Run unittest suite with coverage (ott.osm.tests.test)
run: poetry run coverage run -m unittest -v ott.osm.tests.test

- name: Run osm_abbr_tester.py with coverage
run: poetry run coverage run --append -m ott.osm.tests.osm_abbr_tester

- name: Run docker pytest suite with coverage
run: poetry run coverage run --append -m pytest -v ott/osm/tests/docker/test_project_scripts_docker.py

- name: Coverage report
run: |
poetry run coverage report -m --fail-under=${COVERAGE_FAIL_UNDER}
poetry run coverage xml -o coverage.xml

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml
59 changes: 59 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and Publish Container

on:
push:
branches: [ "**" ]
tags: [ "v*" ]
pull_request:
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Derive image tag from ref
id: img
shell: bash
run: |
RAW_REF="${GITHUB_REF_NAME}"
if [ "${RAW_REF}" = "main" ]; then
TAG="latest"
else
TAG="$(echo "${RAW_REF}" | tr '[:upper:]' '[:lower:]' | sed 's#[^a-z0-9._-]#-#g')"
fi
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "image=ghcr.io/opentransittools/osm:${TAG}" >> "$GITHUB_OUTPUT"

- name: Show resolved image tag
run: |
echo "Ref: $GITHUB_REF"
echo "Image:"
echo "${{ steps.img.outputs.image }}"

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.img.outputs.image }}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ COMMIT_EDITMSG
.idea/*
*.iml
.DS_Store
**/.DS_Store
c:/
.history/

# C extensions
*.so
Expand Down Expand Up @@ -101,3 +103,20 @@ nohup.out
gtfsdb.db.bkup
x
.pydevproject
.vscode

# Always allow repository source and docker definitions.
!ott/
!ott/**
!docker/
!docker/**
!ott/osm/tests/docker/**

# Keep recursive editor/system and generated artifacts ignored even inside ott/ and docker/.
**/.DS_Store
**/.vscode
**/.vscode/**
**/.history
**/.history/**
**/__pycache__/
**/*.py[cod]
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.0.0 (unreleased)
- python 3.14
- poetry
- docker


0.1.0 (2018-04-15)
------------------
- Initial project setup
Expand Down
Loading