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

Update CI/CD pipeline to speed up checks on PRs not altering the Python package #128

Merged
merged 5 commits into from
Apr 3, 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
31 changes: 24 additions & 7 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,29 @@ jobs:
with:
fetch-depth: 0

# - name: Install Gazebo Classic
# if: contains(matrix.os, 'ubuntu')
# run: |
# sudo apt-get update
# sudo apt-get install gazebo
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
conf: &conf
- 'pyproject.toml'
- 'setup.cfg'
- 'setup.py'
src: &src
- 'src/**'
tests: &tests
- 'tests/**'
all:
- *conf
- *src
- *tests

# https://gazebosim.org/docs/harmonic/install_ubuntu
- name: Install Gazebo Sim
if: contains(matrix.os, 'ubuntu')
if: |
contains(matrix.os, 'ubuntu') &&
(github.event_name != 'pull_request' ||
steps.changes.outputs.all == 'true')
run: |
sudo apt-get update
sudo apt-get install lsb-release wget gnupg
Expand All @@ -118,7 +132,10 @@ jobs:
sudo apt-get install gz-harmonic

- name: Run the Python tests
if: contains(matrix.os, 'ubuntu')
if: |
contains(matrix.os, 'ubuntu') &&
(github.event_name != 'pull_request' ||
steps.changes.outputs.all == 'true')
run: pytest
env:
JAX_PLATFORM_NAME: cpu
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
jobs:

black:

name: black
runs-on: ubuntu-latest

Expand All @@ -22,15 +21,17 @@ jobs:
- name: '🐍 Initialize Python'
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.*"

# Note: the black version needs to be in sync with what
# specified in setup.cfg.
- name: "📝 Black Code Formatter"
uses: psf/black@stable
with:
options: --check --diff --color
options: "--check --diff --color"
version: "~= 24.0"

isort:

name: isort
runs-on: ubuntu-latest

Expand All @@ -42,18 +43,17 @@ jobs:
- name: '🐍 Initialize Python'
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.*"

# Workaround for https://github.com/isort/isort-action/issues/70
- run: pip install colorama

- name: "📝 isort"
uses: isort/isort-action@master
with:
configuration: --check --diff --color
configuration: "--check --diff --color"

ruff:

name: ruff
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
- typing_extensions # python<3.12
# Optional dependencies from setup.cfg
# [style]
- black
- black == 24.*
- isort
# [testing]
- idyntree
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ where = src

[options.extras_require]
style =
black[jupyter]
# Note: keep the black version in sync with style.yml and environment.yml.
black[jupyter] ~= 24.0
isort
pre-commit
testing =
Expand Down
Loading