-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. - 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. - Fix issue in upload-artifact excluding dotfiles by default (who introduces breaking changes without major version increment???). - Add caching for {homebrew, apt} packages and build files to try to get the pipeline execution time down.
- Loading branch information
Showing
40 changed files
with
872 additions
and
898 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,18 +7,26 @@ 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: | ||
############################################################################ | ||
# Common setup | ||
############################################################################ | ||
- name: Setup python (all OSes) | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
- name: Clone sample project | ||
shell: bash | ||
working-directory: ../../ | ||
working-directory: ${{ github.workspace }} # Needed to match with scripts/argos-integration-tests.sh | ||
|
||
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 | ||
|
@@ -30,90 +38,122 @@ runs: | |
uses: SimenB/github-actions-cpu-cores@v1 | ||
id: cpu-cores | ||
|
||
- uses: kenchan0130/actions-system-info@master | ||
id: system-info | ||
|
||
- name: Cache build files | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ runner.os }}-${{ steps.system-info.outputs.release }}-build-objects | ||
verbose: 0 | ||
|
||
############################################################################ | ||
# ARGoS setup | ||
############################################################################ | ||
- name: Install ARGoS dependencies | ||
shell: bash | ||
working-directory: ../../ | ||
run: | | ||
# 2023/01/16: || true needed because homebrew installation of whatever | ||
# 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 | ||
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 | ||
fi | ||
- uses: nick-fields/retry@v2 | ||
name: Install ARGoS deps (OSX) | ||
if: runner.os == 'macOS' | ||
with: | ||
timeout_minutes: 10000 | ||
max_attempts: 3 | ||
shell: bash | ||
command: | | ||
# 2023/01/16: Caching doesn't work reliably, for reasons unknown :-(. | ||
# | ||
# The {xquartz, mactex, qt} deps are not required as long as the ARGoS | ||
# integration tests for OSX don't run stage 4+ or try to do video | ||
# capture. Installing them takes ~30 min in github actions, so cutting | ||
# this particular corner saves a TON of time. | ||
# | ||
# Note that by omitting Xquartz you MUST also omit Qt, otherwise CI | ||
# fails (I think ARGoS segfaults). | ||
brew install pkg-config cmake libpng freeimage lua | ||
- name: Install and cache ARGoS dependencies (Linux) | ||
if: runner.os == 'Linux' | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: libfreeimage-dev libfreeimageplus-dev qtbase5-dev freeglut3-dev libxi-dev libxmu-dev liblua5.3-dev lua5.3 libgraphviz-dev ccache | ||
version: ${{ runner.os }} | ||
|
||
- name: Install ARGoS | ||
if: inputs.platform == 'argos' | ||
shell: bash | ||
working-directory: ../../ | ||
run: | | ||
git clone https://github.com/ilpincy/argos3.git | ||
cd argos3 | ||
mkdir -p build && cd build | ||
cmake -DARGOS_DOCUMENTATION=OFF ../src | ||
cmake \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DARGOS_DOCUMENTATION=OFF \ | ||
../src | ||
make -j ${{ steps.cpu-cores.outputs.count }} | ||
sudo make install | ||
- name: Build SIERRA project for ARGoS | ||
if: inputs.platform == 'argos' | ||
working-directory: ../../ | ||
shell: bash | ||
working-directory: ${{ github.workspace }} # Needed to match with scripts/argos-integration-tests.sh | ||
|
||
run: | | ||
cd sierra-sample-project/argos | ||
mkdir -p build && cd build | ||
cmake -DARGOS_INSTALL_DIR=/usr/local .. | ||
cmake \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DARGOS_INSTALL_DIR=/usr/local \ | ||
.. | ||
make -j ${{ steps.cpu-cores.outputs.count }} | ||
############################################################################ | ||
# ROS1+Gazebo setup | ||
############################################################################ | ||
- name: Install ROS1 platform dependency | ||
if: inputs.platform == 'ros1gazebo' | ||
uses: ros-tooling/setup-ros@v0.3 | ||
uses: ros-tooling/setup-ros@v0.7 | ||
with: | ||
required-ros-distributions: ${{ inputs.rosdistro }} | ||
|
||
- name: Install SIERRA ROSbridge dependencies | ||
- name: Install SIERRA ROSbridge system dependencies (Linux) | ||
if: inputs.platform == 'ros1gazebo' | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: 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-cairo intltool python3-wheel python3-rospkg python3-empy | ||
version: ${{ runner.os }} | ||
|
||
- name: Install SIERRA ROSbridge python dependencies (Linux) | ||
if: inputs.platform == 'ros1gazebo' | ||
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 | ||
# 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 \ | ||
catkin_tools | ||
- name: Install SIERRA ROSBridge dependency (ubuntu) | ||
if: inputs.platform == 'ros1gazebo' | ||
working-directory: ../.. | ||
shell: bash | ||
run: | | ||
source /opt/ros/${{ inputs.rosdistro }}/setup.bash | ||
pip3 install catkin_tools | ||
git clone https://github.com/swarm-robotics/sierra_rosbridge.git | ||
git clone https://github.com/jharwell/sierra_rosbridge.git | ||
cd sierra_rosbridge | ||
git checkout devel | ||
catkin init | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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 | ||
- uses: kenchan0130/actions-system-info@master | ||
id: system-info | ||
|
||
- name: Run nox | ||
run: | | ||
nox \ | ||
--pythons ${{ matrix.python-version }} \ | ||
--sessions ${{ matrix.session }} |
Oops, something went wrong.