Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
rscohn2 committed Jun 5, 2024
1 parent 45ba074 commit d6a5ae4
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit d6a5ae4

Please sign in to comment.