refactor(tests): Clean and reorganize App.integration.test #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Workflow | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
validate-pr: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22.2.0 | |
- name: Install dependencies | |
run: npm install | |
- name: Validate PR | |
run: npm run validate:pr | |
post-merge-assets: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22.2.0 | |
- name: Install dependencies | |
run: npm install | |
- name: Check and Generate Coverage | |
run: | | |
if [ ! -f ./coverage/coverage-summary.json ]; then | |
echo "Coverage summary not found. Running tests to generate it..." | |
npm run test:coverage | |
else | |
echo "Coverage summary found. Proceeding..." | |
fi | |
- name: Generate Coverage Assets | |
run: npm run generate-coverage-assets | |
- name: Pull latest changes | |
run: git pull origin main | |
- name: Commit and Push Coverage Assets | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add badges/*.svg badges/coverage-summary.png | |
git commit -m "chore: update coverage badges and summary" || echo "No changes to commit" | |
git push origin main --force-with-lease | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |