chore(ci): print the names of the branches being benchmarked #5
Workflow file for this run
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: Run Perf benchmarks | |
| on: | |
| push: | |
| branches: | |
| - winter* | |
| - spring* | |
| - summer* | |
| - wjh/perf-ci # Just for testing | |
| jobs: | |
| run-performance-tests: | |
| # It is important to use this image so that we have a consistent IP address | |
| runs-on: salesforce-Ubuntu | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.18.1' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Get Previous Release | |
| id: previous_release | |
| run: | | |
| # Parse current season and year from branch name | |
| if [[ "$GITHUB_REF_NAME" =~ ^(winter|spring|summer)([0-9]+)$ ]]; then | |
| season="${BASH_REMATCH[1]}" | |
| year="${BASH_REMATCH[2]}" | |
| else | |
| echo "JUST FOR TESTING" | |
| echo "branch=master" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| # Get previous season and year | |
| case $season in | |
| winter) PREVIOUS="summer$((year - 1))";; | |
| spring) PREVIOUS="winter$year";; | |
| summer) PREVIOUS="spring$year";; | |
| esac | |
| # Expose to GitHub Actions | |
| echo "branch=$PREVIOUS" >> "$GITHUB_OUTPUT" | |
| - name: Build benchmarks | |
| env: | |
| BENCHMARK_REF: ${{steps.previous_release.outputs.branch}} | |
| run: yarn build:performance | |
| - name: Run benchmarks | |
| working-directory: ./packages/@lwc/perf-benchmarks | |
| env: | |
| BENCHMARK_REF: ${{steps.previous_release.outputs.branch}} | |
| run: | | |
| echo "Running benchmarks for $GITHUB_REF_NAME against $BENCHMARK_REF" | |
| yarn test:run | |
| - name: Format results | |
| working-directory: ./packages/@lwc/perf-benchmarks | |
| run: yarn --silent test:format >> "$GITHUB_STEP_SUMMARY" |