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

[DRAFT] CI: skip jobs if no changes to source/tests/cmake are detected #1822

Closed
wants to merge 19 commits into from
Closed
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
40 changes: 40 additions & 0 deletions .github/workflows/check-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check for changes that require running the rest of the CI

on:
workflow_call:
inputs:
directories:
description: 'The directories to check for changes'
required: true
type: string
outputs:
has_changes:
description: 'Whether changes were found or not (yes/no)'
value: ${{ jobs.check.outputs.has_changes }}

jobs:
check:
env:
# put the list of directories to watch for changes here, convert to space-separated list
watch_list: "${{ join(fromJson(inputs.directories), ' ') }}"
runs-on: ubuntu-latest
outputs:
has_changes: ${{ steps.check.outputs.has_changes }}
steps:
- id: fetch
name: Fetch current branch
uses: actions/[email protected]
with:
fetch-depth: 2

- id: check
name: Check for changes
run: |
echo "Checking for changes in ${{ env.watch_list }}"
if git diff --quiet HEAD^ HEAD -- ${{ env.watch_list }}; then
echo "has_changes=no" >> "$GITHUB_OUTPUT"
echo "No changes found in ${{ env.watch_list }}"
else
echo "has_changes=yes" >> "$GITHUB_OUTPUT"
echo "Found changes in ${{ env.watch_list }}"
fi
10 changes: 10 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ concurrency:
cancel-in-progress: true

jobs:
check-changes:
uses: './.github/workflows/check-changes.yml'
with:
directories: "['test/doc/**']"

##################################################################################################
## Randomized precision tests
##################################################################################################
documentation:
needs: check-changes
runs-on: ubuntu-latest
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -31,6 +37,10 @@ jobs:
- { comp: clang, arch: x86 , opts: -msse2 , pch: OFF}
- { comp: gcc , arch: x86 , opts: -msse2 , pch: OFF}
steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ concurrency:
cancel-in-progress: true

jobs:
check-changes:
uses: './.github/workflows/check-changes.yml'
with:
directories: "['cmake/**', 'CMakeLists.txt', 'examples/**', 'test/**', 'include/**', 'doc/**']"

##################################################################################################
## Check install process of EVE via CMake
##################################################################################################
install:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: [ubuntu-latest]
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -43,6 +49,8 @@ jobs:
## Check install process of EVE via CPM
##################################################################################################
cpm:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
runs-on: [ubuntu-latest]
Expand All @@ -64,6 +72,8 @@ jobs:
## Check install process of EVE via FetchContents
##################################################################################################
fetch:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
runs-on: [ubuntu-latest]
Expand All @@ -85,6 +95,8 @@ jobs:
## Check EVE multi-architecture setup
##################################################################################################
multi-arch:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: ubuntu-latest
container:
image: ghcr.io/jfalcou/compilers:v6
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/random.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ concurrency:
cancel-in-progress: true

jobs:
check-changes:
uses: './.github/workflows/check-changes.yml'
with:
directories: "['cmake/**', 'CMakeLists.txt', 'test/random/**', 'include/**']"

##################################################################################################
## Randomized precision tests
##################################################################################################
random:
needs: check-changes
runs-on: ubuntu-latest
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -29,6 +35,11 @@ jobs:
- { comp: clang, arch: x86 , opts: -mavx2 }
- { comp: clang, arch: aarch64, opts: -Wno-psabi}
steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1

- name: Fetch current branch
uses: actions/[email protected]

Expand Down
64 changes: 55 additions & 9 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ concurrency:
cancel-in-progress: true

jobs:

check-changes:
uses: './.github/workflows/check-changes.yml'
with:
directories: "['cmake/**', 'CMakeLists.txt', 'examples/**', 'test/**', 'include/**']"

##################################################################################################
## Check no PCH mode
##################################################################################################
no_pch:
needs: check-changes
runs-on: ubuntu-latest
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -30,6 +35,10 @@ jobs:
- { comp: clang, arch: x86 , opts: -msse2 }
- { comp: gcc , arch: x86 , opts: -msse2 }
steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Prepare EVE with ${{ matrix.cfg.comp }} @ ${{ matrix.cfg.arch }} with ${{ matrix.cfg.opts }}
Expand All @@ -51,6 +60,7 @@ jobs:
## Full emulation tests
##################################################################################################
nosimd:
needs: check-changes
runs-on: ubuntu-latest
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -61,8 +71,11 @@ jobs:
cfg:
- { comp: clang , arch: x86 , opts: -DEVE_NO_SIMD }
- { comp: gcc , arch: x86 , opts: -DEVE_NO_SIMD }

steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Running CMake for ${{ matrix.cfg.comp }} on ${{ matrix.cfg.arch }} with ${{ matrix.cfg.opts }}
Expand All @@ -78,13 +91,18 @@ jobs:
## Mac OS X Targets
##################################################################################################
macosx:
needs: check-changes
runs-on: [macos-12]
strategy:
fail-fast: false
matrix:
cfg:
- { comp: clang , arch: x86_osx, opts: -mavx }
steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Running CMake for ${{ matrix.cfg.comp }} on ${{ matrix.cfg.arch }} with ${{ matrix.cfg.opts }}
Expand All @@ -100,14 +118,18 @@ jobs:
## Windows Targets
##################################################################################################
msvc:
needs: check-changes
runs-on: [windows-2022]
strategy:
fail-fast: false
matrix:
cfg:
- { mode: Debug, options: "-DEVE_NO_FORCEINLINE"}

steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Running CMake for MSVC ${{ matrix.cfg.mode }} ${{ matrix.cfg.options }}
Expand All @@ -131,6 +153,7 @@ jobs:
## Host 1 - Pre-Skylake SIMD ISA - clang
##################################################################################################
x86-clang:
needs: check-changes
runs-on: [self-hosted, generic-x86]
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -142,8 +165,11 @@ jobs:
- { comp: clang , arch: x86, opts: -msse4.2 }
- { comp: clang , arch: x86, opts: -mavx }
- { comp: clang , arch: x86, opts: -mavx2 }

steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Running CMake for ${{ matrix.cfg.comp }} on ${{ matrix.cfg.arch }} with ${{ matrix.cfg.opts }}
Expand All @@ -159,7 +185,7 @@ jobs:
## Host 1 - PPC & ARM SVE256/512 Tests
##################################################################################################
other-arch:
needs: x86-clang
needs: [check-changes, x86-clang]
runs-on: [self-hosted, generic-x86]
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -172,6 +198,10 @@ jobs:
- { comp: gcc, arch: sve512, opts: -Wno-psabi}
- { comp: gcc, arch: ppc64 , opts: -Wno-psabi}
steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Prepare EVE with ${{ matrix.cfg.comp }} @ ${{ matrix.cfg.arch }} with ${{ matrix.cfg.opts }}
Expand All @@ -189,7 +219,7 @@ jobs:
## Host 1 - Pre-Skylake SIMD ISA - g++
##################################################################################################
x86-gcc:
needs: other-arch
needs: [ check-changes, other-arch ]
runs-on: [self-hosted, generic-x86]
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -201,8 +231,11 @@ jobs:
- { comp: gcc , arch: x86, opts: -msse4.2 }
- { comp: gcc , arch: x86, opts: -mavx }
- { comp: gcc , arch: x86, opts: -mavx2 }

steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Running CMake for ${{ matrix.cfg.comp }} on ${{ matrix.cfg.arch }} with ${{ matrix.cfg.opts }}
Expand All @@ -218,6 +251,7 @@ jobs:
## Host 2 - Non-X86 - Requires clang and qemu
##################################################################################################
arm:
needs: [ check-changes ]
runs-on: [self-hosted, avx512]
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -229,6 +263,10 @@ jobs:
- { comp: clang, arch: aarch64 , opts: -Wno-psabi}
- { comp: clang, arch: arm , opts: -Wno-psabi}
steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Prepare EVE with ${{ matrix.cfg.comp }} @ ${{ matrix.cfg.arch }} with ${{ matrix.cfg.opts }}
Expand All @@ -250,7 +288,7 @@ jobs:
## Host 2 - Post-Skylake SIMD ISA
##################################################################################################
avx512:
needs: arm
needs: [ check-changes, arm ]
runs-on: [self-hosted, avx512]
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -263,6 +301,10 @@ jobs:
- { comp: gcc , arch: x86 , opts: -march=skylake-avx512 }

steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Running CMake for ${{ matrix.cfg.comp }} on ${{ matrix.cfg.arch }} with ${{ matrix.cfg.opts }}
Expand All @@ -278,7 +320,7 @@ jobs:
## Host 2 - Pre-Skylake SIMD ISA - Special cases
##################################################################################################
other-cases:
needs: avx512
needs: [ check-changes, avx512 ]
runs-on: [self-hosted, avx512]
container:
image: ghcr.io/jfalcou/compilers:v7
Expand All @@ -294,6 +336,10 @@ jobs:
- { comp: gcc , arch: x86 , opts: "-mavx2 -mbmi2 -DEVE_USE_BMI_ON_AVX2" }

steps:
- name: Early exit if no changes
if: ${{ needs.check-changes.outputs.has_changes == 'no' }}
continue-on-error: true
run: exit 1
- name: Fetch current branch
uses: actions/[email protected]
- name: Running CMake for ${{ matrix.cfg.comp }} on ${{ matrix.cfg.arch }} with ${{ matrix.cfg.opts }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ on:
- main

jobs:
check-changes:
uses: './.github/workflows/check-changes.yml'
with:
directories: "['doc/**']"
generate-doc:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: ubuntu-latest
container:
image: ghcr.io/jfalcou/compilers:v7
Expand Down
Loading