fix(deps): update dependency shiki to v3 #103
This file contains 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: CI - Tests PRs & Main | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'packages/**' | |
- 'vitest.config.mts' | |
branches: [main] | |
pull_request: | |
paths: | |
- 'packages/**' | |
- 'vitest.config.mts' | |
types: | |
- opened | |
- reopened | |
- synchronize | |
concurrency: testing-${{ github.ref }} | |
jobs: | |
run-tests: | |
name: Vitest Test | |
runs-on: ubuntu-latest | |
env: | |
NODE_OPTIONS: "--max_old_space_size=4096" | |
steps: | |
- name: Check out code using Git | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Install Tools & Dependencies | |
uses: withstudiocms/automations/.github/actions/install@main | |
- name: Build Packages | |
run: pnpm ci:build | |
- name: Test Packages | |
run: pnpm ci:test | |
- name: Upload HTML report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vitest-report | |
path: html | |
retention-days: 14 | |
publish-tests: | |
name: Publish Test Results | |
if: ${{ !cancelled() }} | |
needs: [run-tests] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code using Git | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Install Tools & Dependencies | |
uses: withstudiocms/automations/.github/actions/install@main | |
- name: Download HTML report from GitHub Actions Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: vitest-report | |
path: vitest-report | |
# If the push is to the main branch, deploy the test results to GitHub Pages under /vitest folder | |
- name: Deploy Test Results to GitHub Pages | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }} | |
folder: vitest-report | |
target-folder: vitest | |
force: false | |
clean: false | |
branch: test-results | |
# If the push is to a PR, deploy the test results to GitHub Pages under /pr-preview folder | |
- name: Deploy PR Test Results to GitHub Pages | |
uses: rossjrw/pr-preview-action@v1 | |
id: preview-step | |
with: | |
token: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }} | |
source-dir: vitest-report | |
umbrella-dir: pr-preview/vitest/ | |
preview-branch: test-results | |
comment: false | |
- uses: marocchino/sticky-pull-request-comment@v2 | |
if: steps.preview-step.outputs.deployment-action == 'deploy' && env.deployment_status == 'success' | |
with: | |
GITHUB_TOKEN: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }} | |
header: pr-preview | |
message: | | |
# PR Test Results | |
Vitest Test Results: ${{ steps.preview-step.outputs.preview-url }} | |
- uses: marocchino/sticky-pull-request-comment@v2 | |
if: steps.preview-step.outputs.deployment-action == 'remove' && env.deployment_status == 'success' | |
with: | |
GITHUB_TOKEN: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }} | |
header: pr-preview | |
message: | | |
# PR Test Results | |
Results removed because the pull request was closed. | |
${{ steps.preview-step.outputs.action-start-time }} |