Skip to content

Feat/get replaced scheduled data from explorer aggregator #5390

Feat/get replaced scheduled data from explorer aggregator

Feat/get replaced scheduled data from explorer aggregator #5390

Workflow file for this run

name: Run Tests
on:
push:
pull_request:
types: [ opened, synchronize ]
workflow_dispatch:
env:
PRIVATE_MVN_REGISTRY_TOKEN: ${{ secrets.GITLAB_PKG_REGISTRY_TOKEN }}
PRIVATE_MVN_REGISTRY_URL: ${{ secrets.GITLAB_MAVEN_REGISTRY_URL }}
PRIVATE_MVN_REGISTRY_USER: ${{ secrets.PRIVATE_MVN_REGISTRY_USER }}
PRIVATE_MVN_REGISTRY_PASS: ${{ secrets.PRIVATE_MVN_REGISTRY_PASS }}
jobs:
test:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK 18
uses: actions/setup-java@v3
with:
java-version: '18'
distribution: 'temurin'
cache: maven
- name: Setup depends
run: |
pip install yq
- name: Setup maven settings.xml
run: |
envsubst < ./.m2/settings.default.xml.tpl > ./.m2/settings.xml
- name: Check Formatting
run: |
mvn spotless:check
- name: Build
run: |
mvn --batch-mode --update-snapshots clean package -DskipTests
- name: Test
run: |
mvn --batch-mode --update-snapshots test
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
generate-summary: true
badges-directory: build/reports/jacoco/test/html/badges
- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
- name: Publish coverage report to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/main'
with:
BRANCH: gh-pages
folder: build/reports/jacoco/test/html
mutation-test:
needs: test
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK 18
uses: actions/setup-java@v3
with:
java-version: '18'
distribution: 'temurin'
cache: maven
- name: Setup depends
run: |
pip install yq
- name: Setup maven settings.xml
run: |
envsubst < ./.m2/settings.default.xml.tpl > ./.m2/settings.xml
- name: Build
run: |
mvn --batch-mode --update-snapshots clean package -DskipTests
- name: Test
run: |
mvn test-compile org.pitest:pitest-maven:mutationCoverage -DmutationThreshold=19
- name: Publish mutation test report to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/main'
with:
BRANCH: gh-pages
folder: target/pit-reports/
target-folder: mutation-report/
end2end:
needs: test
runs-on: self-hosted
container:
image: postman/newman
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install report library allure
run: npm install -g newman-reporter-allure
- name: Install allure
run: npm install -g allure @apideck/postman-to-k6
- name: Install report library htmlextra
run: npm install -g newman-reporter-htmlextra
- name: Migrate config
run: postman-to-k6 src/test/Postman/Cardano-Explorer-API.postman_collection.json --environment src/test/Postman/DevInt.postman_environment.json -o k6-script.js --skip-post -i 10
- name: Test
run: newman run src/test/Postman/Cardano-Explorer-API.postman_collection.json -e src/test/Postman/DevInt.postman_environment.json -r cli,htmlextra,allure --reporter-htmlextra-export=reporthtml/reporthtml.html --timeout-request 10000
- name: Allure Report action from marketplace
uses: simple-elf/allure-report-action@master
if: github.ref == 'refs/heads/main'
#id: allure-report
with:
allure_results: allure-results
- name: Archive html results
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main'
with:
name: html-report
path: reporthtml
- name: Archive k6 script
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main'
with:
name: k6-script
path: |
k6-script.js
libs/
- name: Archive allure results
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main'
with:
name: allure-report
path: allure-report
loadTest:
if: always()
needs: end2end
runs-on: self-hosted
#container:
# image: loadimpact/k6:latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Run local k6 test
uses: grafana/[email protected]
with:
filename: k6-script/k6-script.js
flags: --vus 10 --out csv=k6_results.csv
- name: Archive allure results
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main'
with:
name: loadtest-report
path: k6_results.csv
pages:
needs: [end2end,loadTest]
if: github.ref == 'refs/heads/main'
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK 18
uses: actions/setup-java@v3
with:
java-version: '18'
distribution: 'temurin'
cache: maven
- name: Setup depends
run: |
pip install yq
- name: Setup maven settings.xml
run: |
envsubst < ./.m2/settings.default.xml.tpl > ./.m2/settings.xml
- name: Build
run: |
mvn --batch-mode --update-snapshots clean package -DskipTests
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Publish mutation test report to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/main'
with:
BRANCH: gh-pages
folder: allure-report
target-folder: allure-report/
- name: Publish mutation test report to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/main'
with:
BRANCH: gh-pages
folder: html-report
target-folder: html-report/
- name: Publish LoadTest report to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/main'
with:
BRANCH: gh-pages
folder: loadtest-report
target-folder: loadtest-report/