Skip to content

Add path filter to only run CI as necessary #10

Add path filter to only run CI as necessary

Add path filter to only run CI as necessary #10

Workflow file for this run

name: Path Filter
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
path-filter:
runs-on: ubuntu-latest
outputs:
spack_only: ${{ steps.filter.outputs.spack_only }}
singularity_only: ${{ steps.filter.outputs.singularity_only }}
docs_only: ${{ steps.filter.outputs.docs_only }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
source_changed:
- 'palace/**'
- 'cmake/**'
- 'extern/**'
examples_changed:
- 'examples/**'
- 'test/examples/**'
tests_changed:
- 'test/unit/**'
spack_changed:
- 'spack_repo/**'
singularity_changed:
- 'singularity/**'
# Dummy jobs that succeed when only spack, singularity or docs files change
build-and-test-linux:
needs: path-filter
if: |
${{ needs.path-filter.outputs.source_changed == 'false'
&& needs.path-filter.outputs.examples_changed == 'false'
&& needs.path-filter.outputs.tests_changed == 'false'}}
strategy:
matrix:
include:
# List of configuration that must be kept in sync with build-and-test-linux.yml
- config: "x86, intel, intelmpi, intelmkl, shared, int64, openmp, slepc, superlu"
- config: "x86, clang, openmpi, aocl, static, int64, serial, slepc, mumps"
- config: "x86, gcc, openmpi, openblas, shared, int64, openmp, slepc, strumpack"
- config: "x86, intel, intelmpi, intelmkl, static, int32, serial, arpack, superlu"
- config: "x86, intel, intelmpi, intelmkl, static, int32, openmp, slepc, strumpack"
- config: "x86, intel, intelmpi, intelmkl, shared, int64, serial, arpack, mumps"
- config: "x86, gcc, openmpi, aocl, shared, int32, serial, arpack, superlu"
- config: "arm, gcc, mpich, openblas, shared, int64, openmp, slepc, superlu"
- config: "arm, clang, openmpi, armpl, static, int32, serial, arpack, strumpack"
- config: "arm, clang, mpich, armpl, shared, int32, serial, arpack, mumps"
- config: "arm, gcc, openmpi, openblas, static, int64, serial, slepc, mumps"
- config: "arm, gcc, openmpi, armpl, shared, int64, serial, arpack, superlu"
- config: "arm, clang, mpich, openblas, static, int32, openmp, slepc, strumpack"
- config: "arm, clang, mpich, openblas, static, int64, serial, arpack, superlu"
- config: "arm, gcc, openmpi, armpl, shared, int32, openmp, slepc, strumpack"
- config: "arm, gcc, openmpi, armpl, shared, int32, openmp, slepc, superlu"
- config: "arm, gcc, openmpi, armpl, shared, int64, openmp, slepc, strumpack"
name: build-and-test-linux (${{ matrix.config }})
runs-on: ubuntu-latest
steps:
- run: echo "Skipping linux build (${{ matrix.config }}) because there were no relevant changes!"
build-and-test-macos:
needs: path-filter
if: |
${{ needs.path-filter.outputs.source_changed == 'false'
&& needs.path-filter.outputs.examples_changed == 'false'
&& needs.path-filter.outputs.tests_changed == 'false'}}
strategy:
matrix:
include:
# List of configuration that must be kept in sync with build-and-test-macos.yml
- config: "clang, openmpi, armpl, static, int32, serial, arpack, strumpack"
- config: "gcc, openmpi, openblas, static, int64, serial, slepc, mumps"
- config: "gcc, openmpi, armpl, shared, int64, serial, arpack, superlu"
- config: "clang, mpich, openblas, static, int32, openmp, slepc, strumpack"
- config: "clang, mpich, openblas, static, int64, serial, arpack, superlu"
name: build-and-test-macos (${{ matrix.config }})
runs-on: macos-latest
steps:
- run: echo "Skipping macos build (${{ matrix.config }}) because there were no relevant changes!"
build-and-test-spack:
needs: path-filter
if: |
${{ needs.path-filter.outputs.source_changed == 'false'
&& needs.path-filter.outputs.examples_changed == 'false'
&& needs.path-filter.outputs.tests_changed == 'false'
&& needs.path-filter.outputs.spack_changed == 'false'}}
strategy:
matrix:
include:
# List of configuration that must be kept in sync with spack.yml
- config: "gcc, none, openblas, develop, openmpi"
name: build-and-test-spack (${{ matrix.config }})
runs-on: ubuntu-latest
steps:
- run: echo "Skipping spack build (${{ matrix.config }}) because there were no relevant changes!"
build-and-test-singularity:
needs: path-filter
if: |
${{ needs.path-filter.outputs.source_changed == 'false'
&& needs.path-filter.outputs.examples_changed == 'false'
&& needs.path-filter.outputs.tests_changed == 'false'
&& needs.path-filter.outputs.singularity_changed == 'false'}}
name: build-and-test-singularity
runs-on: ubuntu-latest
steps:
- run: echo "Skipping singularity build because there were no relevant changes!"