-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,34 +63,43 @@ jobs: | |
# 64 bit int | ||
cmake ${SHARED_OPT} -DBUILD_INDEX64=on -B lapack/build64 | ||
cmake --build lapack/build64 ${PARALLEL} --target install | ||
- name: Check for changes to this domain | ||
id: changes | ||
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | ||
predicate-quantifier: every | ||
- name: Test if the changes affect this domain | ||
id: test_domain | ||
uses: actions/github-script@v4 | ||
with: | ||
list-files: shell | ||
filters: | | ||
src: | ||
# match everything | ||
- '**' | ||
# exclude other domains | ||
- '!src/${{ matrix.exclude }}/**' | ||
- '!tests/unit_tests/${{ matrix.exclude }}/**' | ||
script: | | ||
function matchesPattern(filePaths) { | ||
console.log('files:', filePaths) | ||
const dirs = '(examples|src|include/oneapi/mkl)' | ||
const domains = '(blas|lapack|rng|dft)' | ||
const domain = '${{ matrix.domain }}' | ||
// matches the domain we want or no domain at all | ||
const re = new RegExp(`^(${dirs}/${domain}|(?!${dirs}/${domains}))`); | ||
return filePaths.some(filePath => re.test(filePath)); | ||
} | ||
const pr = context.payload.pull_request | ||
const compare = await github.rest.repos.compareCommits({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
base: pr.base.sha, | ||
head: pr.head.sha | ||
}); | ||
return matchesPattern(compare.data.files.map((f) => f.filename)); | ||
- name: Install oneapi | ||
if: steps.changes.outputs.src == 'true' | ||
if: steps.test_domain.outputs.result == 'true' | ||
uses: rscohn2/setup-oneapi@2ad0cf6b74bc2426bdcee825cf88f9db719dd727 # v0.1.0 | ||
with: | ||
components: | | ||
[email protected] | ||
[email protected] | ||
- name: Configure/Build for a domain | ||
if: steps.changes.outputs.src == 'true' | ||
if: steps.test_domain.outputs.result == 'true' | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
cmake -DTARGET_DOMAINS=${{ matrix.domain }} -DENABLE_MKLGPU_BACKEND=off -DCMAKE_VERBOSE_MAKEFILE=on ${{ matrix.build_options }} -B build | ||
cmake --build build ${PARALLEL} | ||
- name: Run tests | ||
if: steps.changes.outputs.src == 'true' | ||
if: steps.test_domain.outputs.result == 'true' | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
ctest --test-dir build ${{ matrix.test_options }} |