Skip to content

Commit c4c351c

Browse files
authored
Merge pull request #19239 from adityasharad/actions/integration-test-default-filters
Actions: Create initial integration test for default filters
2 parents 21af1c6 + 0bb4ab9 commit c4c351c

File tree

12 files changed

+85
-5
lines changed

12 files changed

+85
-5
lines changed

actions/extractor/tools/autobuild-impl.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (($null -ne $env:LGTM_INDEX_INCLUDE) -or ($null -ne $env:LGTM_INDEX_EXCLUDE)
2121

2222
# Find the JavaScript extractor directory via `codeql resolve extractor`.
2323
$CodeQL = Join-Path $env:CODEQL_DIST 'codeql.exe'
24-
$env:CODEQL_EXTRACTOR_JAVASCRIPT_ROOT = &$CodeQL resolve extractor --language javascript
24+
$env:CODEQL_EXTRACTOR_JAVASCRIPT_ROOT = &"$CodeQL" resolve extractor --language javascript
2525
if ($LASTEXITCODE -ne 0) {
2626
throw 'Failed to resolve JavaScript extractor.'
2727
}
@@ -40,7 +40,7 @@ $env:CODEQL_EXTRACTOR_JAVASCRIPT_SOURCE_ARCHIVE_DIR = $env:CODEQL_EXTRACTOR_ACTI
4040
$env:CODEQL_EXTRACTOR_JAVASCRIPT_TRAP_DIR = $env:CODEQL_EXTRACTOR_ACTIONS_TRAP_DIR
4141
$env:CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE = $env:CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE
4242

43-
&$JavaScriptAutoBuild
43+
&"$JavaScriptAutoBuild"
4444
if ($LASTEXITCODE -ne 0) {
4545
throw "JavaScript autobuilder failed."
4646
}

actions/extractor/tools/autobuild.cmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
22
rem All of the work is done in the PowerShell script
3-
powershell.exe %~dp0autobuild-impl.ps1
3+
powershell.exe "%~dp0autobuild-impl.ps1"

actions/extractor/tools/autobuild.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ else
2626
fi
2727

2828
# Find the JavaScript extractor directory via `codeql resolve extractor`.
29-
CODEQL_EXTRACTOR_JAVASCRIPT_ROOT="$($CODEQL_DIST/codeql resolve extractor --language javascript)"
29+
CODEQL_EXTRACTOR_JAVASCRIPT_ROOT="$("${CODEQL_DIST}/codeql" resolve extractor --language javascript)"
3030
export CODEQL_EXTRACTOR_JAVASCRIPT_ROOT
3131

3232
echo "Found JavaScript extractor at '${CODEQL_EXTRACTOR_JAVASCRIPT_ROOT}'."
@@ -42,4 +42,4 @@ env CODEQL_EXTRACTOR_JAVASCRIPT_DIAGNOSTIC_DIR="${CODEQL_EXTRACTOR_ACTIONS_DIAGN
4242
CODEQL_EXTRACTOR_JAVASCRIPT_SOURCE_ARCHIVE_DIR="${CODEQL_EXTRACTOR_ACTIONS_SOURCE_ARCHIVE_DIR}" \
4343
CODEQL_EXTRACTOR_JAVASCRIPT_TRAP_DIR="${CODEQL_EXTRACTOR_ACTIONS_TRAP_DIR}" \
4444
CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE="${CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE}" \
45-
${JAVASCRIPT_AUTO_BUILD}
45+
"${JAVASCRIPT_AUTO_BUILD}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| src/.github/action.yaml:1:1:11:32 | name: ' ... action' |
2+
| src/.github/actions/action-name/action.yml:1:1:11:32 | name: ' ... action' |
3+
| src/.github/workflows/workflow.yml:1:1:12:33 | name: A workflow |
4+
| src/action.yml:1:1:11:32 | name: ' ... action' |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import actions
2+
3+
from AstNode n
4+
where n instanceof Workflow or n instanceof CompositeAction
5+
select n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'A composite action'
2+
description: 'Do something'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Print
7+
run: echo "Hello world"
8+
shell: bash
9+
10+
- name: Checkout
11+
uses: actions/checkout@v4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'A composite action'
2+
description: 'Do something'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Print
7+
run: echo "Hello world"
8+
shell: bash
9+
10+
- name: Checkout
11+
uses: actions/checkout@v4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: An unreachable workflow
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
job:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: A workflow
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
job:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'A composite action'
2+
description: 'Do something'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Print
7+
run: echo "Hello world"
8+
shell: bash
9+
10+
- name: Checkout
11+
uses: actions/checkout@v4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: An unreachable workflow
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
job:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test(codeql, actions):
2+
codeql.database.create(source_root="src")

0 commit comments

Comments
 (0)