Skip to content

Commit

Permalink
STASH
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Feb 27, 2024
1 parent 99f46bf commit 86d456b
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 84 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
---
name: Run tests

on:
on: # yamllint disable-line rule:truthy
push:
branches: ['main']
branches: ['main', 'devel']
pull_request:

jobs:
canary:
uses: ./.github/workflows/pytest.yaml
with:
# Choose colcon-notification for a canary build. It has colcon
# dependencies and debian patches, so exercieses a fair amount of the
matrix-filter: del(.matrix.os[] | select(contains("windows")))
# Choose rosdistro for a canary build. It has ros-infrastructure
# dependencies and installs scripts, so exercieses a fair amount of the
# CI action features.
repository: colcon/colcon-notification
# Use HEAD to find strategy.json file instead of the tip of colcon/ci
repository: ros-infrastructure/rosdistro
# Use HEAD to find strategy.json file instead of the tip of
# ros-infrastructure/ci
setup-repository: ''
canary-catkin-pkg:
uses: ./.github/workflows/pytest.yaml
with:
repository: ros-infrastructure/catkin_pkg
setup-repository: ''
canary-rospkg:
uses: ./.github/workflows/pytest.yaml
with:
matrix-filter: del(.matrix.os[] | select(contains("windows")))
repository: ros-infrastructure/rospkg
setup-repository: ''
canary-rosinstall-generator:
uses: ./.github/workflows/pytest.yaml
with:
matrix-filter: del(.matrix.os[] | select(contains("windows")))
repository: ros-infrastructure/rosinstall_generator
setup-repository: ''
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: yamllint .
15 changes: 11 additions & 4 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Run tests

on:
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
codecov:
Expand All @@ -9,7 +10,8 @@ on:
required: false
type: boolean
matrix-filter:
description: 'jq filter string indicating which configuration(s) should be included'
description: 'jq filter string indicating which configuration(s)
should be included'
default: '.'
required: false
type: string
Expand All @@ -20,7 +22,7 @@ on:
type: string
setup-repository:
description: 'repository used during job setup'
default: 'colcon/ci'
default: 'ros-infrastructure/ci'
required: false
type: string

Expand Down Expand Up @@ -48,8 +50,13 @@ jobs:
with:
repository: ${{ inputs.repository }}
- uses: actions/setup-python@v5
if: ${{ matrix.python }}
with:
python-version: ${{ matrix.python }}
- uses: cottsay/colcon-ci@main
- uses: actions/checkout@v4
with:
repository: ${{ inputs.setup-repository }}
path: ./.github-ci-action-repo
- uses: ./.github-ci-action-repo
- uses: codecov/codecov-action@v3
if: ${{ inputs.codecov }}
35 changes: 11 additions & 24 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: colcon pytest
description: Continuous integration for colcon repositories
name: ros-infrastructure pytest
description: Continuous integration for ros-infrastructure repositories
runs:
using: composite
steps:
Expand All @@ -23,30 +23,17 @@ runs:
echo ::group::Install dependencies
# Remove this package from constraints
PKG_NAME=$(pip list --local --editable --format json | jq '.[0].name' -r)
grep -v "^${PKG_NAME}@" ${GITHUB_ACTION_PATH}/constraints.txt > constraints.txt
# Install dependencies, including any 'test' extras, as well as pytest-cov
PKG_NAME=$(pip list -l -e --format json | jq '.[0].name' -r | sed 's/-/_/g')

Check failure on line 26 in action.yaml

View workflow job for this annotation

GitHub Actions / yamllint

26:81 [line-length] line too long (84 > 80 characters)
cp -a ${GITHUB_ACTION_PATH}/constraints{,-pins,-heads}.txt ./
echo "Removing '${PKG_NAME}' from constraints-heads.txt"
sed -i'' -e "s/^${PKG_NAME}@.*//g" constraints-heads.txt
# Install dependencies, including any 'test' extras
python -m pip install -U -e .[test] pytest-cov -c constraints.txt
echo ::endgroup::
echo ::group::Run tests
python -m pytest --cov --cov-branch --cov-report xml:coverage.xml --cov-config setup.cfg
echo ::endgroup::
echo ::group::Test publish
# Run publish-python without uploading the results
if [ -f publish-python.yaml ]; then
PUBLISH_PYTHON=$(mktemp -d)
git clone https://github.com/dirk-thomas/publish-python.git $PUBLISH_PYTHON
python -m pip install -U PyYAML wheel
python $PUBLISH_PYTHON/bin/publish-python wheel:pypi
if [ ! -z "${{matrix.stdeb-check}}" ]; then
sudo apt install -y debhelper dh-python fakeroot python3-all python3-stdeb python3-yaml
DEB_BUILD_OPTIONS=nocheck /usr/bin/python3 $PUBLISH_PYTHON/bin/publish-python stdeb:packagecloud
else
echo "Skipping stdeb test on non-Debian platform..."
fi
else
echo "Repository not configured - Skipping..."
fi
python -m pytest \
--cov --cov-branch \
--cov-report xml:coverage.xml \
--cov-config setup.cfg
echo ::endgroup::
10 changes: 10 additions & 0 deletions constraints-heads.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bloom@ git+https://github.com/ros-infrastructure/bloom.git
catkin_pkg@ git+https://github.com/ros-infrastructure/catkin_pkg.git
catkin_sphinx@ git+https://github.com/ros-infrastructure/catkin-sphinx.git
ros_buildfarm@ git+https://github.com/ros-infrastructure/ros_buildfarm.git
rosdep@ git+https://github.com/ros-infrastructure/rosdep.git
rosdistro@ git+https://github.com/ros-infrastructure/rosdistro.git
rosdoc2@ git+https://github.com/ros-infrastructure/rosdoc2.git
rosinstall_generator@ git+https://github.com/ros-infrastructure/rosinstall_generator.git
rospkg@ git+https://github.com/ros-infrastructure/rospkg.git
superflore@ git+https://github.com/ros-infrastructure/superflore.git
Empty file added constraints-pins.txt
Empty file.
48 changes: 2 additions & 46 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,2 @@
colcon-alias@ git+https://github.com/colcon/colcon-alias.git
colcon-argcomplete@ git+https://github.com/colcon/colcon-argcomplete.git
colcon-bash@ git+https://github.com/colcon/colcon-bash.git
colcon-bazel@ git+https://github.com/colcon/colcon-bazel.git
colcon-bundle@ git+https://github.com/colcon/colcon-bundle.git
colcon-cargo@ git+https://github.com/colcon/colcon-cargo.git
colcon-cd@ git+https://github.com/colcon/colcon-cd.git
colcon-clean@ git+https://github.com/colcon/colcon-clean.git
colcon-cmake@ git+https://github.com/colcon/colcon-cmake.git
colcon-common-extensions@ git+https://github.com/colcon/colcon-common-extensions.git
colcon-core@ git+https://github.com/colcon/colcon-core.git
colcon-coveragepy-result@ git+https://github.com/colcon/colcon-coveragepy-result.git
colcon-defaults@ git+https://github.com/colcon/colcon-defaults.git
colcon-devtools@ git+https://github.com/colcon/colcon-devtools.git
colcon-ed@ git+https://github.com/colcon/colcon-ed.git
colcon-gradle@ git+https://github.com/colcon/colcon-gradle.git
colcon-graphviz-anim@ git+https://github.com/colcon/colcon-graphviz-anim.git
colcon-hardware-acceleration@ git+https://github.com/colcon/colcon-hardware-acceleration.git
colcon-installed-package-information@ git+https://github.com/colcon/colcon-installed-package-information.git
colcon-lcov-result@ git+https://github.com/colcon/colcon-lcov-result.git
colcon-library-path@ git+https://github.com/colcon/colcon-library-path.git
colcon-meson@ git+https://github.com/colcon/colcon-meson.git
colcon-metadata@ git+https://github.com/colcon/colcon-metadata.git
colcon-mixin@ git+https://github.com/colcon/colcon-mixin.git
colcon-notification@ git+https://github.com/colcon/colcon-notification.git
colcon-output@ git+https://github.com/colcon/colcon-output.git
colcon-override-check@ git+https://github.com/colcon/colcon-override-check.git
colcon-package-information@ git+https://github.com/colcon/colcon-package-information.git
colcon-package-selection@ git+https://github.com/colcon/colcon-package-selection.git
colcon-parallel-executor@ git+https://github.com/colcon/colcon-parallel-executor.git
colcon-pkg-config@ git+https://github.com/colcon/colcon-pkg-config.git
colcon-powershell@ git+https://github.com/colcon/colcon-powershell.git
colcon-python-setup-py@ git+https://github.com/colcon/colcon-python-setup-py.git
colcon-recursive-crawl@ git+https://github.com/colcon/colcon-recursive-crawl.git
colcon-rerun@ git+https://github.com/colcon/colcon-rerun.git
colcon-ros-bazel@ git+https://github.com/colcon/colcon-ros-bazel.git
colcon-ros-bundle@ git+https://github.com/colcon/colcon-ros-bundle.git
colcon-ros-cargo@ git+https://github.com/colcon/colcon-ros-cargo.git
colcon-ros-domain-id-coordinator@ git+https://github.com/colcon/colcon-ros-domain-id-coordinator.git
colcon-ros@ git+https://github.com/colcon/colcon-ros.git
colcon-ros-gradle@ git+https://github.com/colcon/colcon-ros-gradle.git
colcon-sanitizer-reports@ git+https://github.com/colcon/colcon-sanitizer-reports.git
colcon-spawn-shell@ git+https://github.com/colcon/colcon-spawn-shell.git
colcon-test-result@ git+https://github.com/colcon/colcon-test-result.git
colcon-zsh@ git+https://github.com/colcon/colcon-zsh.git
flake8<6
-c constraints-heads.txt
-c constraints-pins.txt
4 changes: 0 additions & 4 deletions strategy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
{
"os": "ubuntu-20.04",
"python": "3.6"
},
{
"os": "ubuntu-latest",
"stdeb-check": "1"
}
]
}
Expand Down

0 comments on commit 86d456b

Please sign in to comment.