Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,55 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
name: Lint and test project
permissions:
checks: write
contents: write
pull-requests: write
strategy:
matrix:
node: ['18', 'latest']
env:
MAIN_NODE_VER: '18'
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install node 18
- name: Install node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: ${{ matrix.node }}
cache: npm

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

- name: Install project modules
run: npm ci

- name: Lint source files
run: npm run lint

- name: Run unit tests and create coverage report
run: npm run tests:rep
- name: Run unit tests
run: npm run test

- name: Compile project
run: npm run compile

- name: Run integration tests
working-directory: integration
run: bash ./run_it.sh

- name: Report test results
if: always()
uses: dorny/test-reporter@v1.6.0
- name: Upload coverage reports
if: ${{ matrix.node == env.MAIN_NODE_VER }}
uses: actions/upload-artifact@v3
with:
name: Unit Tests Run
path: unit-tests-result.json
reporter: mocha-json
name: coverage
path: ./coverage/coverage-final.json
6 changes: 6 additions & 0 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ jobs:
node-version: '18'
cache: npm

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

- name: Install project modules
run: npm ci

Expand Down
2 changes: 1 addition & 1 deletion src/providers/java_maven.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function provideStack(manifest) {
* @param {string} data - content of pom.xml for component report
* @returns {Provided}
*/
function provideComponent(data) { // WIP
function provideComponent(data) { // eslint-disable-line
return {
ecosystem,
content: 'WIP',
Expand Down
92 changes: 0 additions & 92 deletions test/index.test.js

This file was deleted.

3 changes: 2 additions & 1 deletion test/providers/java_maven.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ suite('testing the java-maven data provider', () => {
contentType: 'text/vnd.graphviz',
content: expectedGraph
})
}).timeout(5000) // these test cases takes ~2500-2700 ms each
// these test cases takes ~2500-2700 ms each pr >10000 in CI (for the first test-case)
}).timeout(process.env.GITHUB_ACTIONS ? 20000 : 5000)
})
})