POSTRELEASE @W-20084011@ Merging after ecosystem release #1458
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: validate-pr | |
| on: | |
| pull_request: | |
| types: [edited, opened, reopened, synchronize] | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| validate_pr_title: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Validate PR Title | |
| if: github.base_ref == 'dev' | |
| run: | | |
| title="${{ github.event.pull_request.title }}" | |
| if [[ "$title" =~ ^(POSTRELEASE|FIX|CHANGE|NEW)([[:space:]]*\([^()]+\))?[[:space:]]*:?[[:space:]]*@W-[[:digit:]]{8,9}@[[:space:]]*.+ ]]; then | |
| echo "Valid PR title: '$title'" | |
| else | |
| echo "::error::Invalid PR title: '$title'. Please following the format: POSTRELEASE|FIX|CHANGE|NEW (__) @W-XXXXXXXX@ Summary" | |
| exit 1 | |
| fi | |
| check_for_postrelease_keyword: | |
| runs-on: macos-latest | |
| outputs: | |
| is-postrelease: ${{ steps.main.outputs.is_postrelease }} | |
| steps: | |
| - name: Check for "Postrelease" keyword in PR title. | |
| id: main | |
| if: github.base_ref == 'dev' | |
| run: | | |
| title="${{ github.event.pull_request.title }}" | |
| if [[ "$title" =~ ^POSTRELEASE ]]; then | |
| echo "is_postrelease=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "is_postrelease=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| validate_packages: | |
| runs-on: macos-latest | |
| needs: check_for_postrelease_keyword | |
| steps: | |
| - name: Support long paths | |
| run: git config --global core.longpaths true | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| - run: npm install | |
| - name: Validate that changed packages are versioned as snapshots | |
| if: ${{ needs.check_for_postrelease_keyword.outputs.is-postrelease == 'false' }} | |
| run: | | |
| BASE_SHA=${{ github.event.pull_request.base.sha }} | |
| HEAD_SHA=${{ github.event.pull_request.head.sha }} | |
| git diff --name-only $HEAD_SHA $BASE_SHA > `pwd`/changed_files.txt | |
| node ./.node-scripts/validate-changed-package-versions.js `pwd`/changed_files.txt | |
| - name: Validate that packages properly depend on each other | |
| if: ${{ needs.check_for_postrelease_keyword.outputs.is-postrelease == 'false' }} | |
| run: | | |
| cd packages | |
| PACKAGE_NAMES=`ls` | |
| cd .. | |
| node ./.node-scripts/validate-package-interdependencies.js "$PACKAGE_NAMES" | |
| run_tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Support long paths | |
| run: git config --global core.longpaths true | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '11' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - run: npm install | |
| - name: Test changes in affected packages | |
| run: | | |
| BASE_SHA=${{ github.event.pull_request.base.sha }} | |
| HEAD_SHA=${{ github.event.pull_request.head.sha }} | |
| git diff --name-only $HEAD_SHA $BASE_SHA > changed_files.txt | |
| node ./.github/workflows/verify-pr/identify-affected-workspaces.mjs changed_files.txt | |
| npm run build `cat workspace-args.txt` | |
| npm run lint | |
| npm run test `cat workspace-args.txt` |