-
Notifications
You must be signed in to change notification settings - Fork 356
Add a 'source-root' input to the init Action #607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
42babdf
337ae83
a05a7f9
57f584a
e1cd524
66df091
35e1b55
a607042
c6728b6
45c0f11
c78fb87
028f98f
67d6f79
1c69fae
2ca807c
12f1cff
2c0da4b
b9217ca
06c6845
a4a91a8
9932052
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -894,3 +894,44 @@ jobs: | |
- name: Build code | ||
run: ./build.sh | ||
- uses: ./../action/analyze | ||
|
||
test-packaging-javascript-source-root: | ||
needs: [check-js, check-node-modules] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Move codeql-action | ||
shell: bash | ||
run: | | ||
mkdir ../action | ||
mv * .github ../action/ | ||
mv ../action/tests/multi-language-repo/{*,.github} . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect this is the problem: it will move all the contents of One option to try might be to avoid these moves entirely, and set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call. That makes sense. |
||
mv ../action/.github/workflows .github | ||
- uses: ./../action/init | ||
with: | ||
config-file: ".github/codeql/codeql-config-packaging.yml" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you may be able to remove this, and keep the test focused on only the source-root feature. |
||
languages: javascript | ||
source-root: tests/multi-language-repo | ||
- name: Build code | ||
shell: bash | ||
run: ./build.sh | ||
- uses: ./../action/analyze | ||
with: | ||
output: "${{ runner.temp }}/results" | ||
env: | ||
TEST_MODE: true | ||
- name: Assert Results | ||
run: | | ||
cd "$RUNNER_TEMP/results" | ||
# We should have 3 hits from these rules | ||
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block" | ||
|
||
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace | ||
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)" | ||
echo "Found matching rules '$RULES'" | ||
if [ "$RULES" != "$EXPECTED_RULES" ]; then | ||
echo "Did not match expected rules '$EXPECTED_RULES'." | ||
exit 1 | ||
fi | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.