Skip to content

Commit

Permalink
Merge branch 'main' into hotfix/little-fix
Browse files Browse the repository at this point in the history
Signed-off-by: Zvi Grinberg <[email protected]>
  • Loading branch information
zvigrinberg authored May 6, 2024
2 parents ce35d87 + 98a67b6 commit beab988
Show file tree
Hide file tree
Showing 6 changed files with 334 additions and 685 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
paths:
- "generated/**"
- "src/**"
- "test/**"
- "package-lock.json"
- "package.json"
- "tsconfig.json"
Expand Down Expand Up @@ -45,6 +46,31 @@ jobs:
cache: npm
registry-url: 'https://npm.pkg.github.com'

- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: maven

- name: setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: get Python location
id: python-location
run: |
echo "python-bin-location=$(echo $pythonLocation)/bin" >> $GITHUB_OUTPUT
- name: setup go
uses: actions/setup-go@v5
with:
go-version: '1.20.1'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Configure git
run: |
git config user.name "${{ github.actor }}"
Expand All @@ -61,6 +87,29 @@ jobs:
- name: Compile project
run: npm run compile

- name: Check if re-test is needed
id: test-check
uses: zvigrinberg/[email protected]
with:
base-ref: ${{ github.base_ref }}
pr-ref: ${{ github.head_ref }}
file-pattern-regex: "^src/.*|^test/.*"

- name: re-test Unit-Tests + Integration Tests
env:
RETEST_IS_NECESSARY: ${{ steps.test-check.outputs.retest-is-needed}}
TRIGGERING_FILE: ${{ steps.test-check.outputs.triggering-file}}
run: |
if [[ $RETEST_IS_NECESSARY == "true" ]]; then
echo "Re-test was triggered!!, triggering changed file - $TRIGGERING_FILE"
echo "Running Again Unit-test =>"
npm run test
echo "Running Again Unit-test =>"
npm run integration-tests
else
echo "Re-test of library is not needed, continuing to deployment!"
fi
- name: Publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_MAVEN_TOKEN }}
Expand Down
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ let stackAnalysisHtml = await exhort.stackAnalysis('/path/to/pom.xml', true)
// Get component analysis in JSON format
let buffer = fs.readFileSync('/path/to/pom.xml')
let componentAnalysis = await exhort.componentAnalysis('pom.xml', buffer.toString())

// Get Component Analysis in JSON Format for gradle
let caGradle = await exhort.componentAnalysis("build.gradle","",{},"path/to/build.gradle")
```
</li>
</ul>
Expand Down Expand Up @@ -156,6 +159,7 @@ $ exhort-javascript-api component pom.xml "$(</path/to/pom.xml)"
<li><a href="https://www.javascript.com//">JavaScript</a> - <a href="https://www.npmjs.com/">Npm</a></li>
<li><a href="https://go.dev//">Golang</a> - <a href="https://go.dev/blog/using-go-modules/">Go Modules</a></li>
<li><a href="https://go.dev//">Python</a> - <a href="https://pypi.org/project/pip/">pip Installer</a></li>
<li><a href="https://gradle.org//">Gradle</a> - <a href="https://gradle.org/install//">Gradle Installation</a></li>
</ul>

<h3>Excluding Packages</h3>
Expand Down Expand Up @@ -186,7 +190,7 @@ Excluding a package from any analysis can be achieved by marking the package for
"name": "sample",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "js",
"keywords": [],
"author": "",
"license": "ISC",
Expand Down Expand Up @@ -258,7 +262,28 @@ zipp==3.6.0

```

All of the 4 above examples are valid for marking a package to be ignored
<em>Gradle</em> users can add in build.gradle a comment with //exhortignore next to the package to be ignored:
```build.gradle
plugins {
id 'java'
}
group = 'groupName'
version = 'version'
repositories {
mavenCentral()
}
dependencies {
implementation "groupId:artifactId:version" // exhortignore
}
test {
useJUnitPlatform()
}
```

All of the 5 above examples are valid for marking a package to be ignored
</li>

</ul>
Expand All @@ -283,18 +308,22 @@ let options = {
'EXHORT_PYTHON3_PATH' : '/path/to/python3',
'EXHORT_PIP3_PATH' : '/path/to/pip3',
'EXHORT_PYTHON_PATH' : '/path/to/python',
'EXHORT_PIP_PATH' : '/path/to/pip'
'EXHORT_PIP_PATH' : '/path/to/pip',
'EXHORT_GRADLE_PATH' : '/path/to/gradle'

}

// Get stack analysis in JSON format
// Get stack analysis in JSON format ( all package managers, pom.xml is as an example here)
let stackAnalysis = await exhort.stackAnalysis('/path/to/pom.xml', false, options)
// Get stack analysis in HTML format (string)
// Get stack analysis in HTML format in string ( all package managers, pom.xml is as an example here)
let stackAnalysisHtml = await exhort.stackAnalysis('/path/to/pom.xml', true, options)

// Get component analysis in JSON format
let buffer = fs.readFileSync('/path/to/pom.xml')
let componentAnalysis = await exhort.componentAnalysis('pom.xml', buffer.toString(), options)

// Get component analysis in JSON format For gradle
let caGradle = await exhort.componentAnalysis("build.gradle","",{},"path/to/build.gradle")
```
**_Environment variables takes precedence._**
</p>
Expand Down Expand Up @@ -347,6 +376,11 @@ following keys for setting custom paths for the said executables.
<td><em>pip</em></td>
<td>EXHORT_PIP_PATH</td>
</tr>
<tr>
<td><a href="https://gradle.org/">Gradle</a></td>
<td><em>gradle</em></td>
<td>EXHORT_GRADLE_PATH</td>
</tr>
</table>

#### Match Manifest Versions Feature
Expand Down
Loading

0 comments on commit beab988

Please sign in to comment.