Skip to content

Restore --ignore-workspace for fixture installs #51

Restore --ignore-workspace for fixture installs

Restore --ignore-workspace for fixture installs #51

Workflow file for this run

name: "Main"
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
- uses: pnpm/action-setup@v4
- run: pnpm install
- run: pnpm lint
- run: pnpm prettier --check
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
name: Test on ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
- uses: pnpm/action-setup@v4
- run: corepack enable
shell: bash
- run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & echo "Started xvfb"
shell: bash
if: ${{ success() && matrix.os == 'ubuntu-latest' }}
- run: pnpm install
- run: pnpm test
env:
DISPLAY: ":99.0"
test-web:
runs-on: ubuntu-latest
name: Test Web Extension
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
- uses: pnpm/action-setup@v4
- run: pnpm install
- run: pnpm exec playwright install --with-deps chromium
- run: pnpm test:web
package:
runs-on: ubuntu-latest
needs: [lint, test, test-web]
name: Package
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
- uses: pnpm/action-setup@v4
- run: pnpm install
- run: npx @vscode/vsce package --no-dependencies
- run: echo "VSIX_PATH=$(find . -maxdepth 1 -type f -iname "*.vsix" | head -1)" >> $GITHUB_ENV
- run: echo "VSIX_NAME=$(basename $(find . -maxdepth 1 -type f -iname "*.vsix" | head -1))" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
path: ${{ env.VSIX_PATH }}
name: ${{ env.VSIX_NAME }}
release:
runs-on: ubuntu-latest
needs: package
if: startsWith(github.ref, 'refs/tags/v')
name: Release
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
- uses: pnpm/action-setup@v4
- name: Check if prerelease
id: check_prerelease
run: |
if [[ "${{ github.ref_name }}" =~ -preview|-beta|-alpha|-rc ]]; then
echo "is_prerelease=true" >> $GITHUB_OUTPUT
else
echo "is_prerelease=false" >> $GITHUB_OUTPUT
fi
- run: pnpm install
- run: npx @vscode/vsce package --no-dependencies ${{ steps.check_prerelease.outputs.is_prerelease == 'true' && '--pre-release' || '' }}
- run: echo "VSIX_PATH=$(find . -maxdepth 1 -type f -iname "*.vsix" | head -1)" >> $GITHUB_ENV
- run: echo "VSIX_NAME=$(basename $(find . -maxdepth 1 -type f -iname "*.vsix" | head -1))" >> $GITHUB_ENV
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" \
--title "${{ github.ref_name }}" \
--generate-notes \
--notes-start-tag "$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo '')" \
${{ steps.check_prerelease.outputs.is_prerelease == 'true' && '--prerelease' || '' }} \
"${{ env.VSIX_PATH }}"
# Append changelog link to release notes
gh release edit "${{ github.ref_name }}" --notes "$(gh release view "${{ github.ref_name }}" --json body -q .body)
---
See the full [CHANGELOG](https://github.com/prettier/prettier-vscode/blob/main/CHANGELOG.md) for details."
- run: npx @vscode/vsce publish --no-dependencies -p ${{ secrets.MARKETPLACE_TOKEN }} ${{ steps.check_prerelease.outputs.is_prerelease == 'true' && '--pre-release' || '' }}