Skip to content

build(deps): bump form-data from 4.0.2 to 4.0.4 in /code/frontend #137

build(deps): bump form-data from 4.0.2 to 4.0.4 in /code/frontend

build(deps): bump form-data from 4.0.2 to 4.0.4 in /code/frontend #137

Workflow file for this run

name: Update Coverage Badge
on:
push:
branches: ['**']
pull_request:
branches: ['**']
types: [opened, synchronize, reopened]
jobs:
update-badge:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run backend coverage
working-directory: ./code/backend/getactivecore
run: |
./gradlew jacocoTestReport
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Generate coverage JSON badge
run: |
pip install lxml
python ../../../.github/scripts/extract_coverage_and_generate_badge.py
mv ../badges/coverage.json /tmp/coverage.json # Move to avoid untracked files git issue in the next step
working-directory: ./code/backend/getactivecore
- name: Checkout coverage-badge branch
run: |
git fetch origin coverage-badge:coverage-badge
git switch coverage-badge
- name: Copy badge to branch
run: |
mkdir -p code/backend/badges
cp -f /tmp/coverage.json code/backend/badges/coverage.json
- name: Commit and push badge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "arshdeepdhillon"
git config user.email "arshdhillon2050@gmail.com"
git add code/backend/badges/coverage.json
git commit -m "Update coverage JSON badge" || echo "No changes"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git push origin coverage-badge