build(deps): bump simple-git from 3.30.0 to 3.31.1 in the dependencies group #3509
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: Build and Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review, labeled] | |
| branches: | |
| - main | |
| workflow_run: | |
| workflows: [Release] | |
| types: [completed] | |
| permissions: | |
| actions: read | |
| contents: read | |
| pull-requests: write # Required for bundlemon to comment on PRs | |
| jobs: | |
| # Validate compatibility with TypeScript Native (tsgo) compiler | |
| # This runs in parallel with build-and-test to catch any tsgo-specific issues early | |
| tsgo-validation: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.draft == false | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | |
| - uses: ./.github/actions/setup-node-pnpm | |
| - name: Build with tsgo | |
| run: pnpm compile:native | |
| - name: Run smoke tests on tsgo output | |
| run: pnpm test:tsgo-build | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.draft == false | |
| outputs: | |
| has-coverage: ${{ steps.upload-coverage.outputs.artifact-id != '' }} | |
| coverage-matrix: ${{ steps.coverage-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | |
| with: | |
| filter: tree:0 | |
| fetch-depth: 0 # Required for nx affected to compare against base branch | |
| - uses: ./.github/actions/setup-node-pnpm | |
| # Check if PR has nx-cloud label to opt-in to Nx Cloud | |
| - name: Check for nx-cloud label | |
| id: nx-cloud-label | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| if echo '${{ toJson(github.event.pull_request.labels.*.name) }}' | jq -e 'index("nx-cloud")' > /dev/null; then | |
| echo "enabled=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "enabled=false" >> $GITHUB_OUTPUT | |
| fi | |
| - uses: ./.github/actions/setup-nx | |
| with: | |
| # Nx Cloud enabled by: repository variable (NX_CLOUD_MAIN/NX_CLOUD_PR) OR 'nx-cloud' PR label | |
| enable-nx-cloud-var: ${{ github.ref == 'refs/heads/main' && vars.NX_CLOUD_MAIN || (vars.NX_CLOUD_PR == 'true' || steps.nx-cloud-label.outputs.enabled == 'true') }} | |
| nx-cloud-token: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
| - name: Run CI checks, builds, and tests | |
| run: | | |
| if [ "${{ github.ref }}" = "refs/heads/main" ]; then | |
| pnpm run ci:all | |
| else | |
| pnpm run ci:affected | |
| fi | |
| # Build dynamic matrix of packages with coverage files | |
| # This ensures we only upload coverage for packages that were actually tested | |
| - name: Build coverage matrix | |
| id: coverage-matrix | |
| if: ${{ !cancelled() }} | |
| run: | | |
| # Define package name to codecov flag mapping | |
| declare -A FLAG_MAP=( | |
| ["dill-cli"]="dill" | |
| ["fundamentals"]="fundamentals" | |
| ["sort-tsconfig"]="sort-tsconfig" | |
| ["cli"]="cli" | |
| ["cli-api"]="cli-api" | |
| ["xkcd2-api"]="xkcd2-api" | |
| ["sail"]="sail" | |
| ["sail-infrastructure"]="sail-infrastructure" | |
| ["rehype-footnotes"]="rehype-footnotes" | |
| ["remark-shift-headings"]="remark-shift-headings" | |
| ["remark-lazy-links"]="remark-lazy-links" | |
| ["remark-task-table"]="remark-task-table" | |
| ["repopo"]="repopo" | |
| ["lilconfig-loader-ts"]="lilconfig-loader-ts" | |
| ) | |
| # Find packages with coverage files and build JSON array | |
| MATRIX="[" | |
| FIRST=true | |
| for coverage_file in packages/*/.coverage/vitest/cobertura-coverage.xml; do | |
| if [ -f "$coverage_file" ]; then | |
| # Extract package name from path | |
| PKG_NAME=$(echo "$coverage_file" | cut -d'/' -f2) | |
| FLAG="${FLAG_MAP[$PKG_NAME]}" | |
| if [ -n "$FLAG" ]; then | |
| if [ "$FIRST" = true ]; then | |
| FIRST=false | |
| else | |
| MATRIX="$MATRIX," | |
| fi | |
| MATRIX="$MATRIX{\"name\":\"$PKG_NAME\",\"flag\":\"$FLAG\"}" | |
| echo "Found coverage for: $PKG_NAME (flag: $FLAG)" | |
| fi | |
| fi | |
| done | |
| MATRIX="$MATRIX]" | |
| echo "Coverage matrix: $MATRIX" | |
| echo "matrix=$MATRIX" >> $GITHUB_OUTPUT | |
| # Upload coverage artifacts for the upload-coverage job | |
| - name: Upload coverage artifacts | |
| id: upload-coverage | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # ratchet:actions/upload-artifact@v5 | |
| with: | |
| name: coverage-reports | |
| path: packages/*/.coverage/vitest/ | |
| include-hidden-files: true | |
| if-no-files-found: ignore | |
| retention-days: 1 | |
| - name: Check for edited files | |
| run: | | |
| git diff | |
| git diff --quiet || (git status -u . && exit 1) | |
| # Upload coverage to Codecov with flags for proper monorepo support | |
| # Uses dynamic matrix based on which packages actually have coverage files | |
| upload-coverage: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| # Only run if we have coverage AND at least one package in the matrix | |
| if: ${{ !cancelled() && needs.build-and-test.outputs.has-coverage == 'true' && needs.build-and-test.outputs.coverage-matrix != '[]' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: ${{ fromJson(needs.build-and-test.outputs.coverage-matrix) }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v5 | |
| - name: Download coverage artifacts | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # ratchet:actions/download-artifact@v6 | |
| with: | |
| name: coverage-reports | |
| path: packages/ | |
| - uses: ./.github/actions/upload-codecov | |
| with: | |
| package-name: ${{ matrix.package.name }} | |
| flag: ${{ matrix.package.flag }} | |
| token: ${{ secrets.CODECOV_TOKEN }} |