diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml index dc04ebc..e828945 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake-single-platform.yml @@ -5,8 +5,11 @@ name: CMake on a single platform on: push: branches: [ "main" ] + paths-ignore: + - run_path_*/** pull_request: - branches: [ "main" ] + paths-ignore: + - run_path_*/** env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) diff --git a/.github/workflows/docker-workflow.yml b/.github/workflows/docker-workflow.yml index b916edf..789578f 100644 --- a/.github/workflows/docker-workflow.yml +++ b/.github/workflows/docker-workflow.yml @@ -1,5 +1,9 @@ name: Action CI -on: [push] +on: + push: + paths-ignore: + - run_path_*/** + jobs: ci: runs-on: ubuntu-latest diff --git a/.github/workflows/path1.yml b/.github/workflows/path1.yml new file mode 100644 index 0000000..04cbb88 --- /dev/null +++ b/.github/workflows/path1.yml @@ -0,0 +1,26 @@ +name: Run on path1 +on: + push: + branches: + - '**' + paths: + - 'run_path_1/**' +# pull_request: +# branches: +# - 'main' +# paths: +# - 'run_path_1/**' + +jobs: + list_files: + name: List file on folder 1 + runs-on: ubuntu-latest + + steps: + - name: Checking out repo + uses: actions/checkout@v5 + + - name: "List files on folder 1" + run: ls -la run_path_1 + + diff --git a/.github/workflows/path2.yml b/.github/workflows/path2.yml new file mode 100644 index 0000000..9213a5b --- /dev/null +++ b/.github/workflows/path2.yml @@ -0,0 +1,22 @@ +name: Run on path2 +on: + push: + branches: + - '**' + paths: + - 'run_path_2/**' + +jobs: + list_files: + name: List file on folder 2 + runs-on: ubuntu-latest + + steps: + - name: Checking out repo + uses: actions/checkout@v5 + + - name: "List files on folder 2" + run: ls -la run_path_2 + + + diff --git a/README.md b/README.md index 6532084..07e61b9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # git-actions-sandbox Sandbox for playing aroud with git actions stuff + +A dummy change to test workflow trigger... + +This should not run cmake workflow.... \ No newline at end of file diff --git a/run_path_1/README.md b/run_path_1/README.md new file mode 100644 index 0000000..53eb5cb --- /dev/null +++ b/run_path_1/README.md @@ -0,0 +1,18 @@ +# Workflow on path 1 + +I want to trigger workflow on path 1 + +Trying to fix path on workflow... + - That worked... but I have two workflows, one for commit and one for PR + +Adding checkout action worked!!! + +Not good... Changing path1 workflow to not listen on PRs, but only on push... + +Remove push on branch... + +Adding branches and PR again on path1 workflow + +I expect to run path1 workflow **ONLY** + +Why it runs also cmake workflow??? \ No newline at end of file diff --git a/run_path_1/path_1_1/path_1_2/path_1_3/README.md b/run_path_1/path_1_1/path_1_2/path_1_3/README.md new file mode 100644 index 0000000..039498b --- /dev/null +++ b/run_path_1/path_1_1/path_1_2/path_1_3/README.md @@ -0,0 +1,3 @@ +Path_3 + +Nothing???? \ No newline at end of file diff --git a/run_path_2/README.md b/run_path_2/README.md new file mode 100644 index 0000000..fa36696 --- /dev/null +++ b/run_path_2/README.md @@ -0,0 +1,11 @@ +# Test workflow on path 2 + +Test if path1 is triggered on path 1. + +Not good... Changing path1 workflow to not listen on PRs, but only on push... + +Try to fix path2 + +Fix path filter on path2 workflow... + +Only path2... \ No newline at end of file diff --git a/run_path_3/README.md b/run_path_3/README.md new file mode 100644 index 0000000..794cbae --- /dev/null +++ b/run_path_3/README.md @@ -0,0 +1,13 @@ +# Folder 3 + +No run is monitored by this folder... + +Adding something to folder 3, should not trigger path1 workflow because of both branch and paths. + +Remove PR from path1 but keeping push on ANY branch and path... No workflow run expected since this is on folder 3. + +It seems I nailed it down!!! + +No workflow no.... + +No run expected \ No newline at end of file