See Build pipeline triggers to learn more. You can enable the build to run continuously when pushing to a branch and even on pull requests. Other than the xvfb setup script for Linux that is necessary to run VS Code in headless Linux CI machines, the definition is straight-forward: trigger : branches : include : - main tags : include : - v* strategy : matrix : linux : imageName : 'ubuntu-latest' mac : imageName : 'macos-latest' windows : imageName : 'windows-latest' pool : vmImage : $(imageName) steps : - task : inputs : versionSpec : '10.x' displayName : 'Install Node.js' - bash : | /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & echo "> Started xvfb" displayName : Start xvfb condition : and(succeeded(), eq(variables, 'Linux')) - bash : | echo "> Compile vscode-test" yarn & yarn compile echo "> Compiled vscode-test" cd sample echo "> Run sample integration test" yarn & yarn compile & yarn test displayName : Run Tests env : DISPLAY : ':99.0'įinally, create a new pipeline in your DevOps project and point it to the azure-pipelines.yml file. Then, add the following azure-pipelines.yml file to the root of your extension's repository. This section explains how to set up an Azure Pipelines for running your extension tests.įirst, create a free account on Azure DevOps and create an Azure DevOps project for your extension. For Open Source projects, you get unlimited minutes and 10 free parallel jobs. Azure PipelinesĪzure Pipelines is great for running VS Code extension tests as it supports running the tests on Windows, macOS, and Linux. Secret variables are never exposed, so they are safe to use in a CI pipeline. By storing the PAT as a VSCE_PAT secret variable, vsce will be able to use it. The publish command is similar to publishing from a local environment using vsce, but you must somehow provide the Personal Access Token (PAT) in a secure way. You can also configure the CI to publish a new version of the extension automatically. You can check out the build pipeline or jump directly to the azure-pipelines.yml file. The library helps you set up extension tests on CI providers and contains a sample extension setup on Azure Pipelines. Extension integration tests can be run on CI services.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |