Skip to content

D/w 17330636 testing 2 #761

D/w 17330636 testing 2

D/w 17330636 testing 2 #761

Workflow file for this run

name: validate-pr
on:
pull_request:
types: [edited, opened, reopened, synchronize]
defaults:
run:
shell: bash
jobs:
run_experiment_part_1:
runs-on: macos-latest
outputs:
output-thing: ${{ steps.main.outputs.output_thing }}
steps:
- id: main
run: |
OUTPUT_THING=()
OUTPUT_THING+=('abcd')
OUTPUT_THING+=('bcde')
OUTPUT_THING+=('cdef')
OUTPUT_THING+=('defg')
OUTPUT_THING_STR=$(IFS=' '; echo "${OUTPUT_THING[*]}")
echo "output_thing=$OUTPUT_THING_STR" >> "$GITHUB_OUTPUT"
run_experiment_part_2:
runs-on: macos-latest
needs: run_experiment_part_1
steps:
- run: |
LIST_TYPE_VARIABLE=(${{ needs.run_experiment_part_1.outputs.output-thing }})
STRING_TYPE_VARIABLE="${{ needs.run_experiment_part_1.outputs.output-thing }}"
node ./.github/workflows/verify-pr/experiment-script.js "$LIST_TYPE_VARIABLE"
node ./.github/workflows/verify-pr/experiment-script.js "$STRING_TYPE_VARIABLE"
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:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- 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 }}
CHANGED_FILES=`git diff --name-only $HEAD_SHA $BASE_SHA`
node ./.github/workflows/verify-pr/validate-changed-package-versions.js "$CHANGED_FILES"
- 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 ./.github/workflows/verify-pr/validate-package-interdependencies.js "$PACKAGE_NAMES"
run_tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- 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
- run: npm run all