feat: initial setup #1
This file contains hidden or 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: Test and create badges | |
| on: | |
| push: | |
| paths: | |
| - "src/**" | |
| branches: | |
| - main | |
| jobs: | |
| create-badge: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| # Setup bun | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| # Configure Git | |
| - name: Git configuration | |
| run: | | |
| git config --global user.email "137602160+bebrasmell@users.noreply.github.com>" | |
| git config --global user.name "Zak (GitHub Actions)" | |
| # Install deps | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| # Run tests | |
| - name: Test | |
| run: bun test:badges | |
| # Commit changes | |
| - name: Commit coverage badge changes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git add "badges/coverage.svg" | |
| git commit -m "chore: update badge" || exit 0 | |
| git push origin || exit 0 |