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

Run yamllint in CI for this repository #26

Merged
merged 1 commit into from
Mar 8, 2024
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
8 changes: 7 additions & 1 deletion .github/workflows/ci.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
cottsay marked this conversation as resolved.
Show resolved Hide resolved
push:
branches: ['main']
pull_request:
Expand All @@ -16,3 +17,8 @@ jobs:
repository: colcon/colcon-notification
# Use HEAD to find strategy.json file instead of the tip of colcon/ci
setup-repository: ''
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: yamllint -f github .
6 changes: 4 additions & 2 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 Down
23 changes: 18 additions & 5 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,37 @@ runs:
PKG_NAME=$(pip list -l -e --format json | jq '.[0].name' -r | tr _ -)
cp -a ${GITHUB_ACTION_PATH}/constraints{,-heads,-pins}.txt ./
sed -i.orig "s/^${PKG_NAME}@.*//g" constraints-heads.txt
# Install dependencies, including any 'test' extras, as well as pytest-cov
# Install dependencies, including 'test' extras, as well as pytest-cov
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
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
pushd $PUBLISH_PYTHON
git clone https://github.com/dirk-thomas/publish-python.git .
popd
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
sudo apt install \
debhelper \
dh-python \
fakeroot \
python3-all \
python3-stdeb \
python3-yaml \
-y
DEB_BUILD_OPTIONS=nocheck /usr/bin/python3 \
$PUBLISH_PYTHON/bin/publish-python stdeb:packagecloud
else
echo "Skipping stdeb test on non-Debian platform..."
fi
Expand Down