Skip to content
Draft
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
70 changes: 65 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
name: MISP2 tests
on: [pull_request]
on:
push:
branches:
- develop
paths:
- 'web-app/**'
- '.github/**'
- 'orbeon-war/**'
- 'packages/**'
- 'utils/**'
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'web-app/**'
- '.github/**'
- 'orbeon-war/**'
- 'packages/**'
- 'utils/**'
jobs:
run-test:
runs-on: ubuntu-22.04
Expand All @@ -14,13 +31,56 @@ jobs:
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
gradle-home-cache-cleanup: true
- name: Run test
run: ./gradlew test
- name: Store upload test artifacts
- name: Test report
env:
NODE_OPTIONS: '--max-old-space-size=6144'
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Unit and integration tests
path: web-app/build/test-results/**/TEST-*.xml
reporter: java-junit
list-suites: 'failed'
list-tests: 'failed'
- name: Store test screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: Test results
path: |
/home/runner/work/misp2/misp2/web-app/build/reports/tests/test/index.html
/home/runner/work/misp2/misp2/web-app/build/it-screenshots/
path: /home/runner/work/misp2/misp2/web-app/build/it-screenshots/
sonar-analysis:
name: Analyse source
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
submodules: 'true'
# Bit of a hacky solution so that the CLI would run (exits with code 1 if build.gradle is found)
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
gradle-home-cache-cleanup: true
- name: Run build
run: ./gradlew build -x test
- name: Remove build.gradle so that we can use the CLI
run: |
rm -f build.gradle
rm -f web-app/build.gradle
# Running CLI because JAVA 8 is not supported by the plugin anymore
- name: Sonar analysis
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5 changes: 5 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sonar.projectKey=nordic-institute_misp2-test
sonar.organization=nordic-institute

sonar.sources=web-app/src
sonar.java.binaries=web-app/build