Skip to content

Checkbox based CI workflow #2177

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

Merged
merged 26 commits into from
Apr 26, 2025
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
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
### Describe your changes

### Issue ticket number and link if any

### Checklist for finalizing the PR

- [ ] I have performed a [self-review](https://f3d.app/doc/dev/CODING_STYLE.html) of my code
- [ ] I have added [tests](https://f3d.app/doc/dev/TESTING.html) for new features and bugfixes
- [ ] I have added [documentation](https://f3d.app/doc/dev/TESTING.html) for new features
- [ ] If it is a modifying the libf3d API, I have updated bindings
- [ ] If it is a modifying the default versions, I have updated timestamp

### Continuous integration

Please check the checkbox of the CI you want to run, then push again on your branch.

- [ ] Style checks
- [ ] Fast CI
- [ ] Coverage cached CI
- [ ] Analysis cached CI
- [ ] WASM CI
- [ ] Android CI
- [ ] macOS Intel cached CI
- [ ] macOS ARM cached CI
- [ ] Windows cached CI
- [ ] Linux cached CI
- [ ] Other cached CI
113 changes: 89 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,42 @@ concurrency:

jobs:

#----------------------------------------------------------------------------
# Detect checkboxes are checked
#----------------------------------------------------------------------------
detect_checkboxes:
name: Detect Checkboxes
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
outputs:
checked: ${{ steps.detect.outputs.checked }}
unchecked: ${{ steps.detect.outputs.unchecked }}

permissions:
pull-requests: write

steps:
- name: Checkbox Trigger
id: detect
uses: AhmedBaset/checklist@3
with:
token: ${{ github.token }}

- name: list changes
run: |
echo "checked=${{ steps.detect.outputs.checked }}"
echo "unchecked=${{ steps.detect.outputs.unchecked }}"
echo "${{ github.ref }}"

#----------------------------------------------------------------------------
# Default versions: Set default version for all dependencies
#----------------------------------------------------------------------------
default_versions:
runs-on: ubuntu-22.04
container: ghcr.io/f3d-app/f3d-ci
name: Set default versions
needs: detect_checkboxes
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'CI')) || (github.ref == 'refs/heads/master') }}
outputs:
alembic_version: ${{ steps.set_default_versions.outputs.alembic_version }}
alembic_min_version: ${{ steps.set_default_versions.outputs.alembic_min_version }}
Expand Down Expand Up @@ -67,6 +96,8 @@ jobs:
cache_lfs:
runs-on: ubuntu-22.04
name: Update LFS data cache
needs: detect_checkboxes
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'CI')) || (github.ref == 'refs/heads/master') }}
outputs:
lfs_sha: ${{ steps.lfs_sha_recover.outputs.lfs_sha }}
steps:
Expand All @@ -89,7 +120,8 @@ jobs:
#----------------------------------------------------------------------------
cache_dependencies:
name: Cache dependencies
needs: default_versions
needs: [default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'cached CI')) || (github.ref == 'refs/heads/master') }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -148,9 +180,8 @@ jobs:
# Windows CI: Build and test, cross-vtk build matrix
#----------------------------------------------------------------------------
windows:
if: github.event.pull_request.draft == false
needs: [cache_lfs, cache_dependencies, default_versions]

needs: [cache_lfs, cache_dependencies, default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Windows cached CI')) || (github.ref == 'refs/heads/master') }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -188,12 +219,45 @@ jobs:
usd_version: ${{needs.default_versions.outputs.usd_version}}
java_version: ${{needs.default_versions.outputs.java_version}}

#----------------------------------------------------------------------------
# Linux fast CI: Build and test a single fast CI
#----------------------------------------------------------------------------
linux_fast:
needs: [cache_lfs, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Fast CI')) || (github.ref == 'refs/heads/master') }}

runs-on: ubuntu-22.04
container: ghcr.io/f3d-app/f3d-ci

env:
DISPLAY: :0

steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
lfs: false

- name: Generic CI
uses: ./source/.github/actions/generic-ci
with:
build_type: fast
vtk_version: v9.4.2
raytracing_label: no-raytracing
rendering_backend: auto
optional_deps_label: no-optional-deps
exclude_deprecated_label: exclude-deprecated
static_label: no-static
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}

#----------------------------------------------------------------------------
# Linux CI: Build and test, cross-vtk build matrix
#----------------------------------------------------------------------------
linux:
if: github.event.pull_request.draft == false
needs: [cache_lfs, cache_dependencies, default_versions]
needs: [cache_lfs, cache_dependencies, default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Linux cached CI')) || (github.ref == 'refs/heads/master') }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -349,8 +413,9 @@ jobs:
# MacOS CI: Build and test, cross-vtk build matrix
#----------------------------------------------------------------------------
macos:
if: github.event.pull_request.draft == false
needs: [cache_lfs, cache_dependencies, default_versions]
needs: [cache_lfs, cache_dependencies, default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'macOS Intel cached CI')) || (github.ref == 'refs/heads/master') }}

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -387,8 +452,8 @@ jobs:
# MacOS ARM CI: Build and test, cross-vtk build matrix with a few optional builds
#----------------------------------------------------------------------------
macos_arm:
if: github.event.pull_request.draft == false
needs: [cache_lfs, cache_dependencies, default_versions]
needs: [cache_lfs, cache_dependencies, default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'macOS ARM cached CI')) || (github.ref == 'refs/heads/master') }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -437,8 +502,8 @@ jobs:
# Python packaging: Build and test the Python wheel
#----------------------------------------------------------------------------
python-packaging:
if: github.event.pull_request.draft == false
needs: [cache_lfs, cache_dependencies, default_versions]
needs: [cache_lfs, cache_dependencies, default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Other cached CI')) || (github.ref == 'refs/heads/master') }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -491,8 +556,8 @@ jobs:
# Coverage: Build and test on linux with last VTK with coverage option
#----------------------------------------------------------------------------
coverage:
needs: [cache_lfs, cache_dependencies, default_versions]
if: github.event.pull_request.draft == false
needs: [cache_lfs, cache_dependencies, default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Coverage cached CI')) || (github.ref == 'refs/heads/master') }}

runs-on: ubuntu-22.04
container: ghcr.io/f3d-app/f3d-ci
Expand Down Expand Up @@ -532,8 +597,8 @@ jobs:
# "memory" returns false positives in VTK:
# https://stackoverflow.com/questions/60097307/memory-sanitizer-reports-use-of-uninitialized-value-in-global-object-constructio
sanitizer:
needs: [cache_lfs, cache_dependencies, default_versions]
if: github.event.pull_request.draft == false
needs: [cache_lfs, cache_dependencies, default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Other cached CI')) || (github.ref == 'refs/heads/master') }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -574,8 +639,8 @@ jobs:
# static-analysis: Run static analysis on linux
#----------------------------------------------------------------------------
static-analysis:
needs: [cache_lfs, cache_dependencies, default_versions]
if: github.event.pull_request.draft == false
needs: [cache_lfs, cache_dependencies, default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Analysis cached CI')) || (github.ref == 'refs/heads/master') }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -613,8 +678,8 @@ jobs:
# external-build: Check build of F3D as sub-project
#----------------------------------------------------------------------------
external-build:
needs: [cache_dependencies, default_versions]
if: github.event.pull_request.draft == false
needs: [cache_dependencies, default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Other cached CI')) || (github.ref == 'refs/heads/master') }}

strategy:
fail-fast: false
Expand All @@ -640,8 +705,8 @@ jobs:
# android: Check build of F3D for android
#----------------------------------------------------------------------------
android:
if: github.event.pull_request.draft == false
needs: default_versions
needs: [default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Android CI')) || (github.ref == 'refs/heads/master') }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -669,8 +734,8 @@ jobs:
# webassembly: Build webassembly artifacts
#----------------------------------------------------------------------------
webassembly:
if: github.event.pull_request.draft == false
needs: default_versions
needs: [default_versions, detect_checkboxes]
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'WASM CI')) || (github.ref == 'refs/heads/master') }}

strategy:
fail-fast: false
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/style-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,39 @@ on:
name: Style Checks
jobs:

style-checks:
name: Formatting Check
#----------------------------------------------------------------------------
# Detect checkboxes are checked
#----------------------------------------------------------------------------
detect_checkboxes:
name: Detect Checkboxes
runs-on: ubuntu-latest
outputs:
checked: ${{ steps.detect.outputs.checked }}
unchecked: ${{ steps.detect.outputs.unchecked }}

permissions:
pull-requests: write

steps:
- name: Checkbox Trigger
id: detect
uses: AhmedBaset/checklist@3
with:
token: ${{ github.token }}

- name: list changes
run: |
echo "checked=${{ steps.detect.outputs.checked }}"
echo "unchecked=${{ steps.detect.outputs.unchecked }}"

#----------------------------------------------------------------------------
# Style checks
#----------------------------------------------------------------------------
style_checks:
name: Formatting Check
runs-on: ubuntu-latest
needs: detect_checkboxes
if: ${{ (contains(needs.detect_checkboxes.outputs.checked, 'Style checks')) }}
env:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down