mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-21 14:35:27 -04:00
Skip tests on documentation-only changes (#3727)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
7861adf53b
commit
179048b801
1 changed files with 42 additions and 3 deletions
45
.github/workflows/ci.yml
vendored
45
.github/workflows/ci.yml
vendored
|
|
@ -1,4 +1,4 @@
|
|||
name: CI
|
||||
name: Tests and Coverage
|
||||
|
||||
on:
|
||||
# allows us to run workflows manually
|
||||
|
|
@ -21,7 +21,25 @@ env:
|
|||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
filter-changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
source_changed: ${{ steps.filter.outputs.source_changed }}
|
||||
steps:
|
||||
- name: Check out the repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Examine changed files
|
||||
id: filter
|
||||
uses: dorny/paths-filter@668c092af3649c4b664c54e4b704aa46782f6f7c # latest master commit, not released yet
|
||||
with:
|
||||
filters: |
|
||||
source_changed:
|
||||
- '!docs/**'
|
||||
- '!**/*.md'
|
||||
predicate-quantifier: 'every'
|
||||
main:
|
||||
needs: filter-changes
|
||||
if: ${{ needs.filter-changes.outputs.source_changed == 'true' }}
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -205,12 +223,33 @@ jobs:
|
|||
flag-name: C++ and Python
|
||||
path-to-lcov: coverage.lcov
|
||||
|
||||
finish:
|
||||
needs: main
|
||||
coverage:
|
||||
needs: [filter-changes, main]
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Coveralls Finished
|
||||
if: ${{ needs.filter-changes.outputs.source_changed == 'true' }}
|
||||
uses: coverallsapp/github-action@v2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
parallel-finished: true
|
||||
|
||||
ci-pass:
|
||||
needs: [filter-changes, main, coverage]
|
||||
name: Check CI status
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check CI status
|
||||
run: |
|
||||
if [[ "${{ needs.filter-changes.outputs.source_changed }}" == "false" ]]; then
|
||||
echo "Documentation-only change - CI skipped successfully"
|
||||
exit 0
|
||||
fi
|
||||
if [[ "${{ needs.main.result }}" == "success" && "${{ needs.coverage.result }}" == "success" ]]; then
|
||||
echo "CI passed"
|
||||
exit 0
|
||||
fi
|
||||
echo "CI failed"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue