Skip to content

Commit

Permalink
Try new workflow to check files
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Nov 16, 2024
1 parent 38d17f5 commit b36ae0a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/check_diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check changed files

on:
pull_request:

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-checkdiff
cancel-in-progress: true

jobs:
check_diff:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
run: |
git diff --name-only --diff-filter=ACMRTUXB ${GITHUB_BASE_REF}..${GITHUB_HEAD_REF} > check_diff.txt
- name: Check changed files
run: |
if grep -v -E "^(docs|\.github)/" check_diff.txt; then
echo "skip=false" >> ${GITHUB_OUTPUT}
else
echo "skip=true" >> ${GITHUB_OUTPUT}
fi
outputs:
skip: ${{ steps.check.outputs.skip_workflows }}
9 changes: 6 additions & 3 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- "development"
pull_request:
workflow_run:
workflows: [Check changed files]
types: [completed]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-cuda
Expand All @@ -18,7 +21,7 @@ jobs:
build_nvcc:
name: NVCC 11.3 SP
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }}
env:
CXXFLAGS: "-Werror"
CMAKE_GENERATOR: Ninja
Expand Down Expand Up @@ -110,7 +113,7 @@ jobs:
build_nvcc_gnumake:
name: NVCC 11.8.0 GNUmake
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }}
steps:
- uses: actions/checkout@v4
- name: install dependencies
Expand Down Expand Up @@ -144,7 +147,7 @@ jobs:
build_nvhpc24-1-nvcc:
name: [email protected] NVCC/NVC++ Release [tests]
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }}
#env:
# # For NVHPC, Ninja is slower than the default:
# CMAKE_GENERATOR: Ninja
Expand Down

0 comments on commit b36ae0a

Please sign in to comment.