Skip to content

removed yarn dependency and added NPM #652

removed yarn dependency and added NPM

removed yarn dependency and added NPM #652

Workflow file for this run

# This is a basic workflow
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [main]
pull_request:
branches: [main]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Set up Node
- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Remove Yarn on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
$paths = @(
"$env:USERPROFILE\.yarn\bin\yarn.cmd",
"$env:USERPROFILE\.yarn\bin\yarnpkg.cmd",
"C:\Program Files (x86)\Yarn\bin\yarn.cmd",
"C:\Program Files (x86)\Yarn\bin\yarnpkg.cmd",
"C:\Program Files\Yarn\bin\yarn.cmd",
"C:\Program Files\Yarn\bin\yarnpkg.cmd"
)
foreach ($path in $paths) {
if (Test-Path $path) {
Remove-Item $path -Force
}
}
if (Get-Command yarn -ErrorAction SilentlyContinue) {
yarn --version
} else {
Write-Output "✅ Yarn not found"
}
- name: Remove Yarn on Linux/macOS
if: runner.os != 'Windows'
run: |
rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg
rm -f /Users/runner/.yarn/bin/yarn /Users/runner/.yarn/bin/yarnpkg
echo "🧹 Yarn removed"
- name: Check for yarn
run: |
which yarn || echo "✅ Yarn not found"
yarn --version || echo "✅ Yarn not used"
# Run install dependencies
- name: Install dependencies
run: npm ci
# Build extension
- name: Run build
run: npm run build
# Run tests
- name: Run Test
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 #v1.0.1
with:
run: npm test
# Run UI tests
- name: Run UI Test
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 #v1.0.1
with:
run: npm run ui-test
options: -screen 0 1920x1080x24
#Package vsix
- name: Build .vsix package on Linux
if: matrix.os == 'ubuntu-latest'
run: |
VERSION=$(node -p "require('./package.json').version")
npx vsce package -o vscode-yaml-${VERSION}-${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}.vsix
#Upload vsix
- name: Upload linux-built vsix
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: vscode-yaml
path: vscode-yaml*.vsix
# Archive test results
- name: Archiving test artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-artifacts
path: |
test-resources/screenshots/*.png
retention-days: 2