mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Actions: Add integration test for default filter behaviour
Include a reachable workflow, and several unreachable workflow files. Include action metadata files at various depths, all reachable. This test exercises the default filters when the user doesn't specify paths/paths-ignore.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
| src/.github/action.yaml:1:1:11:32 | name: ' ... action' |
|
||||
| src/.github/actions/action-name/action.yml:1:1:11:32 | name: ' ... action' |
|
||||
| src/.github/workflows/workflow.yml:1:1:12:33 | name: A workflow |
|
||||
| src/action.yml:1:1:11:32 | name: ' ... action' |
|
||||
5
actions/ql/integration-tests/filters-default/actions.ql
Normal file
5
actions/ql/integration-tests/filters-default/actions.ql
Normal file
@@ -0,0 +1,5 @@
|
||||
import actions
|
||||
|
||||
from AstNode n
|
||||
where n instanceof Workflow or n instanceof CompositeAction
|
||||
select n
|
||||
11
actions/ql/integration-tests/filters-default/src/.github/action.yaml
vendored
Normal file
11
actions/ql/integration-tests/filters-default/src/.github/action.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
name: 'A composite action'
|
||||
description: 'Do something'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Print
|
||||
run: echo "Hello world"
|
||||
shell: bash
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
11
actions/ql/integration-tests/filters-default/src/.github/actions/action-name/action.yml
vendored
Normal file
11
actions/ql/integration-tests/filters-default/src/.github/actions/action-name/action.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
name: 'A composite action'
|
||||
description: 'Do something'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Print
|
||||
run: echo "Hello world"
|
||||
shell: bash
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
12
actions/ql/integration-tests/filters-default/src/.github/unreachable-workflow.yml
vendored
Normal file
12
actions/ql/integration-tests/filters-default/src/.github/unreachable-workflow.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
name: An unreachable workflow
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
job:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
12
actions/ql/integration-tests/filters-default/src/.github/workflows/workflow.yml
vendored
Normal file
12
actions/ql/integration-tests/filters-default/src/.github/workflows/workflow.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
name: A workflow
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
job:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
11
actions/ql/integration-tests/filters-default/src/action.yml
Normal file
11
actions/ql/integration-tests/filters-default/src/action.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
name: 'A composite action'
|
||||
description: 'Do something'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Print
|
||||
run: echo "Hello world"
|
||||
shell: bash
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -0,0 +1,12 @@
|
||||
name: An unreachable workflow
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
job:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
2
actions/ql/integration-tests/filters-default/test.py
Executable file
2
actions/ql/integration-tests/filters-default/test.py
Executable file
@@ -0,0 +1,2 @@
|
||||
def test(codeql, actions):
|
||||
codeql.database.create(source_root="src")
|
||||
Reference in New Issue
Block a user