Skip to content

Add path filter to only run CI as necessary #7

Add path filter to only run CI as necessary

Add path filter to only run CI as necessary #7

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: |
spack_only:
- 'spack_repo/local/**'
- '!**/*'
singularity_only:
- 'singularity/local/**'
- '!**/*'
docs_only:
- '**/*.md'
- 'docs/**'
- '!**/*'
# Dummy jobs that succeed when only spack, singularity or docs files change
build-and-test-linux:
needs: path-filter
if: |
${{ needs.path-filter.outputs.spack_only == 'true'
|| needs.path-filter.outputs.singularity_only == 'true'
|| needs.path-filter.outputs.docs_only == 'true' }}
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 }}) as only Spack, Singularity or docs files changed"
build-and-test-macos:
needs: path-filter
if: ${{ needs.path-filter.outputs.spack_only == 'true'
|| needs.path-filter.outputs.singularity_only == 'true'
|| needs.path-filter.outputs.docs_only == 'true' }}
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 }}) as only Spack, Singularity or docs files changed"
build-and-test-spack:
needs: path-filter
if: ${{ needs.path-filter.outputs.singularity_only == 'true' || needs.path-filter.outputs.docs_only == 'true' }}
strategy:
matrix:
include:
# List of configuration that must be kept in sync with spack.yml
- config: "gcc, none, openblas, develop, openmpi"
name: spack (${{ matrix.config }})
runs-on: ubuntu-latest
steps:
- run: echo "Skipping spack build (${{ matrix.config }}) as only Singularity or docs files changed"
build-and-test-singularity:
needs: path-filter
if: ${{ needs.path-filter.outputs.spack_only == 'true' || needs.path-filter.outputs.docs_only == 'true' }}
strategy:
matrix:
include:
# List of configuration that must be kept in sync with spack.yml
- config: "gcc, none, openblas, develop, openmpi"
name: spack (${{ matrix.config }})
runs-on: ubuntu-latest
steps:
- run: echo "Skipping singularity build as only Spack or docs files changed"