Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI and update to latest Ubuntu/Python versions #454

Open
wants to merge 10 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 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
27 changes: 11 additions & 16 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"name": "py_trees-38",
"name": "py_trees-310",

"build": {
"dockerfile": "./Dockerfile",
"args": {
"NAME": "py_trees",
"POETRY_VERSION": "1.3.2",
"PYTHON_VERSION": "3.8.16",
"NAME": "py_trees-310",
"POETRY_VERSION": "1.8.4",
"PYTHON_VERSION": "3.10.15",
"DEBIAN_VERSION": "bullseye"
},
"context": ".."
}
},
"containerEnv": {
"POETRY_HTTP_BASIC_PYPI_USERNAME": "${localEnv:POETRY_HTTP_BASIC_PYPI_USERNAME}",
Expand All @@ -20,19 +19,15 @@
"vscode": {
"extensions": [
"bierner.github-markdown-preview",
"bierner.markdown-preview-github-styles",
"bungcip.better-toml",
"eamodio.gitlens",
"ms-python.python",
"omnilib.ufmt",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"tht13.rst-vscode"
"lextudio.restructuredtext",
"ms-python.python",
"omnilib.ufmt"
]
}
},
"postCreateCommand": "poetry install",
// Breaks codespaces
// "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces,type=bind",
// "workspaceFolder": "/workspaces"
}
"workspaceMount": "source=${localWorkspaceFolder}/../..,target=/workspaces,type=bind",
"workspaceFolder": "/workspaces"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "py_trees-310",
"name": "py_trees-312",

"build": {
"dockerfile": "../../Dockerfile",
"args": {
"NAME": "py_trees-310",
"POETRY_VERSION": "1.3.2",
"PYTHON_VERSION": "3.10.9",
"NAME": "py_trees-312",
"POETRY_VERSION": "1.8.4",
"PYTHON_VERSION": "3.12.4",
"DEBIAN_VERSION": "bullseye"
}
},
"context": ".."
},
"containerEnv": {
"POETRY_HTTP_BASIC_PYPI_USERNAME": "${localEnv:POETRY_HTTP_BASIC_PYPI_USERNAME}",
Expand All @@ -19,15 +20,19 @@
"vscode": {
"extensions": [
"bierner.github-markdown-preview",
"bierner.markdown-preview-github-styles",
"bungcip.better-toml",
"streetsidesoftware.code-spell-checker",
"lextudio.restructuredtext",
"eamodio.gitlens",
"ms-python.python",
"omnilib.ufmt"
"omnilib.ufmt",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"tht13.rst-vscode"
]
}
},
"postCreateCommand": "poetry install",
"workspaceMount": "source=${localWorkspaceFolder}/../..,target=/workspaces,type=bind",
"workspaceFolder": "/workspaces"
}
// Breaks codespaces
// "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces,type=bind",
// "workspaceFolder": "/workspaces"
}
12 changes: 6 additions & 6 deletions .github/workflows/pre-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ on:

jobs:
pre-merge:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.8", "3.10"]
python-version: ["3.10", "3.12"]
include:
- python-version: "3.8"
python-py-version: "py38"
- python-version: "3.10"
python-py-version: "py310"
- python-version: "3.12"
python-py-version: "py312"
container:
image: ghcr.io/${{ github.repository }}-ci:${{ matrix.python-py-version }}-poetry-bullseye
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Poetry Venv Dir
run: |
echo "VENV_DIR=$(poetry config virtualenvs.path)" >> $GITHUB_ENV

- name: Restore the Cache
id: cache-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.VENV_DIR }}
# bump the suffix if you need to force-refresh the cache
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/push_poetry_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-ci
POETRY_VERSION: 1.3.2
PYTHON_PRIMARY_VERSION: 3.8.16
PYTHON_PRIMARY_TAG: py38
PYTHON_SECONDARY_VERSION: 3.10.9
PYTHON_SECONDARY_TAG: py310
PYTHON_PRIMARY_VERSION: 3.10.15
PYTHON_PRIMARY_TAG: py310
PYTHON_SECONDARY_VERSION: 3.12.4
PYTHON_SECONDARY_TAG: py312
DEBIAN_VERSION: bullseye

on:
Expand All @@ -20,22 +20,22 @@ on:

jobs:
push-poetry-container:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Login to GCR
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Echo
Expand All @@ -48,7 +48,7 @@ jobs:
echo "TAGS: ${{ steps.meta.outputs.tags }}"
echo "LABELS: ${{ steps.meta.outputs.labels }}"
- name: Image - poetry${{ env.POETRY_VERSION }}-python${{ env.PYTHON_PRIMARY_VERSION }}
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
file: ./.devcontainer/Dockerfile
push: true
Expand All @@ -61,7 +61,7 @@ jobs:
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:python${{ env.PYTHON_PRIMARY_VERSION }}-poetry${{ env.POETRY_VERSION }}-${{ env.DEBIAN_VERSION }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image - poetry${{ env.POETRY_VERSION }}-python${{ env.PYTHON_SECONDARY_VERSION }}
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
file: ./.devcontainer/Dockerfile
push: true
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/update-poetry-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@ on:

jobs:
update-poetry-cache:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.8", "3.10"]
python-version: ["3.10", "3.12"]
include:
- python-version: "3.8"
python-py-version: "py38"
- python-version: "3.10"
python-py-version: "py310"
python-py-version: "py10"
- python-version: "3.12"
python-py-version: "py312"
container:
image: ghcr.io/${{ github.repository }}-ci:${{ matrix.python-py-version }}-poetry-bullseye
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Poetry Venv Dir
run: |
echo "VENV_DIR=$(poetry config virtualenvs.path)" >> $GITHUB_ENV

- name: Restore the Cache
id: cache-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.VENV_DIR }}
# bump the suffix if you need to force-refresh the cache
Expand Down
8 changes: 4 additions & 4 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Test-Format-Lint

Check against at least one of py38 / py310 [1].
Check against at least one of py310 / py312 [1].

```
# Auto-format your code (if using VSCode, install the ufmt extension)
Expand All @@ -15,13 +15,13 @@ $ poetry run tox -e format
$ poetry run tox -e check

# Type-Check
$ poetry run mypy38
$ poetry run mypy310

# Tests
$ poetry run tox -e py38
$ poetry run tox -e py310
```

[1] CI will test against both python versions for you, but should you wish to do so locally, open up two VSCode windows, one with the project opened in the default [py38 devcontainer](.devcontainer) and the other with the [py310 devcontainer](.devcontainer/py310).
[1] CI will test against both python versions for you, but should you wish to do so locally, open up two VSCode windows, one with the project opened in the default [py310 devcontainer](.devcontainer) and the other with the [py312 devcontainer](.devcontainer/py312).

## Documentation

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ py-trees-demo-blackboard-remappings py-trees-demo-eternal-guard

# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py38 py310 format check mypy38 mypy310
py310 py312 format check mypy310 mypy312
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py310
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
Expand Down
Loading
Loading