Skip to content

Commit

Permalink
feature(#315): Support python 3.10+
Browse files Browse the repository at this point in the history
Revamp CI workflow, condense files and jobs down, using matrices where
possible. Main idea: test with {earliest python+OS version, latest python+OS
version}, and assume that if those work then everything in between will work
too.

Also fix subtle nasty bug with pipeline where a nested usage of the
actions/checkout@v3 action caused inner the publish job always to run against
the master branch.
  • Loading branch information
jharwell committed Sep 4, 2024
1 parent 0588c2b commit cdb531c
Show file tree
Hide file tree
Showing 33 changed files with 666 additions and 742 deletions.
3 changes: 1 addition & 2 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ inputs:
runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/sierra-setup
- name: Build package
shell: bash
Expand All @@ -37,7 +36,7 @@ runs:

uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
skip-existing: true
user: __token__
password: ${{ inputs.testpypi-token }}
repository_url: https://test.pypi.org/legacy/
Expand Down
83 changes: 60 additions & 23 deletions .github/actions/sample-project-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ inputs:
rosdistro:
description: 'The version of ROS to test with'
default: 'noetic'
# outputs:
# time: # id of output
# description: 'The time we greeted you'

runs:
using: 'composite'
steps:
Expand All @@ -18,7 +16,7 @@ runs:
working-directory: ../../
run: |
if [ ! -d sierra-sample-project ]; then
git clone https://github.com/swarm-robotics/sierra-sample-project.git
git clone https://github.com/jharwell/sierra-sample-project.git
cd sierra-sample-project
else
cd sierra-sample-project
Expand All @@ -41,13 +39,34 @@ runs:
# dependencies these packages requires manual intervention to fix, and I
# don't have a mac.
if [ "${{ runner.os }}" == "macOS" ]; then
brew install pkg-config cmake libpng freeimage lua qt \
docbook asciidoc graphviz doxygen|| true
brew install \
pkg-config \
cmake \
libpng \
freeimage \
lua \
qt \
docbook \
asciidoc \
graphviz \
doxygen \
|| true
elif [ "${{ runner.os }}" == "Linux" ]; then
sudo apt-get update
sudo apt-get install cmake libfreeimage-dev libfreeimageplus-dev \
qt5-default freeglut3-dev libxi-dev libxmu-dev liblua5.3-dev \
lua5.3 doxygen graphviz libgraphviz-dev asciidoc
sudo apt-get install -y \
cmake \
libfreeimage-dev \
libfreeimageplus-dev \
qtbase5-dev \
freeglut3-dev \
libxi-dev \
libxmu-dev \
liblua5.3-dev \
lua5.3 \
doxygen \
graphviz \
libgraphviz-dev \
asciidoc
fi
- name: Install ARGoS
Expand Down Expand Up @@ -86,24 +105,42 @@ runs:
working-directory: ../..
shell: bash
run: |
sudo apt-get install ros-${{ inputs.rosdistro }}-desktop-full
sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-description
sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-msgs
sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-gazebo
sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-bringup
sudo apt-get install python${{ matrix.python-version }} python${{ matrix.python-version }}-dev
sudo apt-get install python${{ matrix.python-version }}-venv python3-apt
sudo apt-get install python3-pip python3-cairo intltool python3-wheel python3-rospkg python3-empy
sudo apt-get install -y \
ros-${{ inputs.rosdistro }}-desktop-full \
ros-${{ inputs.rosdistro }}-turtlebot3-description \
ros-${{ inputs.rosdistro }}-turtlebot3-msgs \
ros-${{ inputs.rosdistro }}-turtlebot3-gazebo \
ros-${{ inputs.rosdistro }}-turtlebot3-bringup \
python${{ matrix.python-version }} \
python${{ matrix.python-version }}-dev \
python${{ matrix.python-version }}-venv \
python3-apt \
python3-pip \
python3-cairo \
intltool \
python3-wheel \
python3-rospkg \
python3-empy
# 2023/1/18: You still need install these even after installing stuff
# with apt AND if the sysem python matches your current python. I don't
# know why.
pip3 install empy
pip3 install rospkg wheel pyparsing pyqt5
pip3 install pyqt5 pysip numpy rospkg
pip3 install matplotlib pyyaml psutil
pip3 install pysip defusedxml pyparsing pydev
pip3 install pyopengl opencv-python
pip3 install empy \
rospkg \
wheel \
pyparsing \
pyqt5 \
pysip \
numpy \
matplotlib \
pyyaml \
psutil \
defusedxml \
pyparsing \
pydev \
pyopengl \
opencv-python
- name: Install SIERRA ROSBridge dependency (ubuntu)
if: inputs.platform == 'ros1gazebo'
Expand Down
13 changes: 7 additions & 6 deletions .github/actions/sierra-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
# Ubuntu setup
############################################################################
- name: Setup python (ubuntu)
uses: actions/setup-python@v4
uses: actions/setup-python@v5
if: runner.os == 'Linux'
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -26,8 +26,9 @@ runs:
shell: bash
run: |
sudo apt-get update
sudo apt-get install parallel cm-super texlive-fonts-recommended
sudo apt-get install texlive-latex-extra dvipng pssh ffmpeg xvfb
sudo apt-get install parallel cm-super texlive-fonts-recommended -y
sudo apt-get install texlive-latex-extra dvipng pssh ffmpeg xvfb -y
python3 -m pip install --upgrade pip
python3 -m pip install wheel
Expand All @@ -36,7 +37,7 @@ runs:
############################################################################

- name: Setup python (OSX)
uses: actions/setup-python@v4
uses: actions/setup-python@v5
if: runner.os == 'macOS'
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -55,8 +56,8 @@ runs:
brew update && brew install parallel pssh ffmpeg
brew update && brew install --cask mactex
brew update && brew install --cask xquartz
python -m pip install --upgrade pip
python -m pip install wheel
python3 -m pip install --upgrade pip
python3 -m pip install wheel
############################################################################
# SIERRA install
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/analysis-top.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Analysis Top-level

# Run:
#
# - Every month. Scheduling helps keep drift/issues with updates
# to runners at bay.
# - On pushes.
on:
push:
paths:
- 'sierra/**'

schedule:
- cron: '0 0 1 * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze-ci-ubuntu-2004:
uses: ./.github/workflows/analyze-nox.yml
secrets: inherit
with:
os: ubuntu-20.04

analyze-ci-ubuntu-2204:
uses: ./.github/workflows/analyze-nox.yml
secrets: inherit
with:
os: ubuntu-22.04

analyze-ci-osx:
uses: ./.github/workflows/analyze-nox.yml
secrets: inherit
with:
os: macos-12
43 changes: 43 additions & 0 deletions .github/workflows/analyze-nox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: OS Static Analysis

on:
workflow_call:
inputs:
os:
required: True
type: string

jobs:
nox:
runs-on: ${{ inputs.os }}
strategy:
matrix:
os:
- ${{ inputs.os }}

# 2024/08/26: Test the earliest and latest supported version, to speed
# up CI.
python-version:
- 3.8
- 3.11

session:
- lint
- docs
- analyze_pytype
- analyze_mypy

exclude:
- python-version: 3.11
os: ubuntu-20.04

- python-version: 3.8
os: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/sierra-setup

- name: Run nox
run: |
nox --pythons ${{ matrix.python-version }} --sessions ${{ matrix.session }}
Loading

0 comments on commit cdb531c

Please sign in to comment.