Manuelle clone #46
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: Monorepo CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build-test-coverage: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| project: | |
| - astro-sprite | |
| - btld-template | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Check for changes in ${{ matrix.project }} | |
| id: changes | |
| uses: tj-actions/changed-files@v44 | |
| with: | |
| files: | | |
| ${{ matrix.project }}/** | |
| - name: Build ${{ matrix.project }} | |
| if: steps.changes.outputs.any_changed == 'true' | |
| run: npm run build | |
| working-directory: ${{ matrix.project }} | |
| - name: Test ${{ matrix.project }} | |
| if: steps.changes.outputs.any_changed == 'true' | |
| run: npm run ci-test | |
| working-directory: ${{ matrix.project }} | |
| - name: Generate coverage report for ${{ matrix.project }} | |
| if: steps.changes.outputs.any_changed == 'true' | |
| run: npm run ci-coverage | |
| working-directory: ${{ matrix.project }} | |
| - name: Upload coverage to Codecov | |
| if: steps.changes.outputs.any_changed == 'true' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ${{ matrix.project }}/coverage/lcov.info | |
| flags: ${{ matrix.project }} | |
| verbose: true |