Skip to content

Feature: setup base plugin #4

Feature: setup base plugin

Feature: setup base plugin #4

name: 'Check Pull Request for plugin: http provider'
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'http-provider/**'
jobs:
tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
architecture: x64
- name: Set up Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Start fake HTTP server
working-directory: src/test/fake-http-server
run: |
npm install
npm run start &
sleep 5
- name: Install Pandoc
run: sudo apt-get update && sudo apt-get install -y pandoc
- name: Execute unit tests
run: mvn -ntp -pl http-provider test
- name: Execute mutation tests
run: mvn -ntp org.pitest:pitest-maven:mutationCoverage
- name: Extract summary from pitest
run: echo "<html><head></head><body><h1>Pit Test Coverage Report</h1><h3>Project Summary</h3>" > pitest.html && perl -0777 -ne 'print "$1\n" if /(<table>.*?<\/table>)/s' target/pit-reports/index.html >> pitest.html && echo "</body></html>" >> pitest.html
- name: Convert pitest report to markdown
run: pandoc --from html --to markdown_github --no-highlight pitest.html
- name: Post comment
uses: luukkemp/pr-comment@2024.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: pitest.html
- name: Execute sonar scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -ntp sonar:sonar -Dsonar.token=$SONAR_TOKEN -Dsonar.branch.name=${{ github.head_ref }}