-
Notifications
You must be signed in to change notification settings - Fork 448
Add new packs input to init action
#591
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,7 +101,8 @@ jobs: | |
| fi | ||
|
|
||
| # Packaging test that runs against a javascript database | ||
| test-packaging-javascript: | ||
| # Specifying packs in the config file. | ||
| test-packaging-javascript-config: | ||
| needs: [check-js, check-node-modules] | ||
| runs-on: ubuntu-latest | ||
|
|
||
|
|
@@ -143,6 +144,97 @@ jobs: | |
| exit 1 | ||
| fi | ||
|
|
||
| # Packaging test that runs against a javascript database | ||
| # Specifying packs as an input. | ||
| test-packaging-javascript-inputs: | ||
| needs: [check-js, check-node-modules] | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Move codeql-action | ||
edoardopirovano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| shell: bash | ||
| run: | | ||
| mkdir ../action | ||
| mv * .github ../action/ | ||
| mv ../action/tests/multi-language-repo/{*,.github} . | ||
| mv ../action/.github/workflows .github | ||
| - uses: ./../action/init | ||
| with: | ||
| config-file: ".github/codeql/codeql-config-packaging2.yml" | ||
| languages: javascript | ||
| packs: dsp-testing/[email protected], dsp-testing/codeql-pack2 | ||
edoardopirovano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # TODO: this can be removed when cli v2.5.6 is released and available in the tool cache | ||
| tools: https://github.com/dsp-testing/aeisenberg-codeql-action-packaging/releases/download/codeql-bundle-20210615/codeql-bundle-linux64.tar.gz | ||
|
|
||
| - 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)" | ||
edoardopirovano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo "Found matching rules '$RULES'" | ||
| if [ "$RULES" != "$EXPECTED_RULES" ]; then | ||
| echo "Did not match expected rules '$EXPECTED_RULES'." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Packaging test that runs against a javascript database | ||
| # Specifying packs in the config file and inputs. | ||
| test-packaging-javascript-config-and-inputs: | ||
| 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} . | ||
| mv ../action/.github/workflows .github | ||
| - uses: ./../action/init | ||
| with: | ||
| config-file: ".github/codeql/codeql-config-packaging3.yml" | ||
| packs: +dsp-testing/[email protected] | ||
| languages: javascript | ||
| # TODO: this can be removed when cli v2.5.6 is released and available in the tool cache | ||
| tools: https://github.com/dsp-testing/aeisenberg-codeql-action-packaging/releases/download/codeql-bundle-20210615/codeql-bundle-linux64.tar.gz | ||
|
|
||
| - 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 | ||
|
|
||
|
|
||
| # Identify the CodeQL tool versions to integration test against. | ||
| check-codeql-versions: | ||
| needs: [check-js, check-node-modules] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.