Build and Test #1889
Workflow file for this run
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: Build and Test | |
on: | |
pull_request: | |
branches: | |
- main | |
check_run: | |
types: [rerequested, requested_action] | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.head_ref || github.ref_name || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
lintExtension: | |
name: Lint Extension | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- run: npm ci | |
- run: npx eslint | |
testExtension: | |
name: Test Extension | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
julia-version: ['1.0', '1.6', '1.10', '1.11'] | |
os: [ubuntu-latest, windows-latest, macos-13] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- uses: julia-actions/install-juliaup@v2 | |
with: | |
channel: ${{matrix.julia-version}} | |
- run: npm ci | |
- run: npm run compile | |
- run: xvfb-run -a npm test | |
if: runner.os == 'Linux' | |
- run: npm test | |
if: runner.os != 'Linux' | |
testJuliaPackages: | |
name: Test Julia Packages | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '1.10', '1.11'] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
exclude: | |
- os: macos-latest | |
julia-version: 1.4 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: julia-actions/install-juliaup@v2 | |
with: | |
channel: ${{matrix.julia-version}} | |
- name: 'Run the Julia tests' | |
run: | | |
julia -e 'using InteractiveUtils; versioninfo()' | |
julia --project=./scripts/testenvironments/debugadapter/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("DebugAdapter", coverage=true)' | |
julia --project=./scripts/testenvironments/vscodedebugger/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("VSCodeDebugger", coverage=true)' | |
julia --project=./scripts/testenvironments/vscodeserver/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("VSCodeServer", coverage=true)' | |
testJuliaLSPackages: | |
name: Test Julia LS Packages | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
julia-version: ['1.10', '1.11'] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: julia-actions/install-juliaup@v2 | |
with: | |
channel: ${{matrix.julia-version}} | |
- name: 'Run the Julia tests' | |
run: | | |
julia -e 'using InteractiveUtils; versioninfo()' | |
julia --project=./scripts/environments/languageserver/v${{matrix.julia-version}} -e 'using Pkg; Pkg.resolve()' | |
julia --project=./scripts/environments/languageserver/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("CSTParser", coverage=true)' | |
julia --project=./scripts/environments/languageserver/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("JSONRPC", coverage=true)' | |
julia --project=./scripts/environments/languageserver/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("LanguageServer", coverage=true)' | |
julia --project=./scripts/environments/languageserver/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("StaticLint", coverage=true)' | |
julia --project=./scripts/environments/languageserver/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("SymbolServer", coverage=true)' | |
julia --project=./scripts/environments/languageserver/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("TestItemDetection", coverage=true)' | |
julia --project=./scripts/environments/languageserver/v${{matrix.julia-version}} -e 'using Pkg; Pkg.test("JuliaWorkspaces", coverage=true)' | |
deployOriginalTag: | |
name: Deploy Tag Version | |
needs: [lintExtension, testExtension, testJuliaPackages, testJuliaLSPackages] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- run: npm ci | |
- name: Install vsce | |
run: npm install -g vsce | |
- name: Package package | |
run: vsce package --pre-release | |
- name: Find filename | |
shell: pwsh | |
run: | | |
$filename = (Get-ChildItem *.vsix)[0].FullName | |
echo "PACKAGE_FILENAME=$($filename)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Release to GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{env.PACKAGE_FILENAME}} | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deployPreRelease: | |
name: Deploy Pre-release Version | |
needs: [lintExtension, testExtension, testJuliaPackages, testJuliaLSPackages] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
environment: insider-channel | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
fetch-depth: '0' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Configure git | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- run: npm ci | |
- name: Install vsce | |
run: npm install -g vsce | |
- name: Increase version | |
shell: pwsh | |
run: | | |
$versionnumber = (npm version patch) | Out-String | |
echo "VERSION_NUMBER=$($versionnumber.trim())" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Package package | |
run: vsce package --pre-release | |
- name : Publish git tag | |
run: git push --tags | |
continue-on-error: true | |
- name: Find filename | |
shell: pwsh | |
run: | | |
$filename = (Get-ChildItem *.vsix)[0].FullName | |
echo "PACKAGE_FILENAME=$($filename)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Publish package to VS Code Marketplace | |
env: | |
VSCEKEY: ${{secrets.VSCEKEY}} | |
run: vsce publish --pre-release -p $VSCEKEY --packagePath $PACKAGE_FILENAME | |
- name: Release to GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{env.PACKAGE_FILENAME}} | |
prerelease: true | |
tag_name: ${{env.VERSION_NUMBER}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Publish package to Open VSX Marketplace | |
# env: | |
# OVSXKEY: ${{secrets.OVSXKEY}} | |
# run: | | |
# npx ovsx publish $PACKAGE_FILENAME -p $OVSXKEY | |
deployRelease: | |
name: Deploy Release Version | |
needs: [deployPreRelease] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
environment: release-channel | |
steps: | |
- name: Compute version | |
shell: pwsh | |
run: | | |
$refname = "${{github.ref_name}}" | |
$v = New-Object System.Management.Automation.SemanticVersion($refname.SubString(1)) | |
$preReleaseVersion = "v" + (New-Object System.Management.Automation.SemanticVersion $v.Major, $v.Minor, ($v.Patch + 1)).ToString() | |
echo "PRERELEASE_VERSION_NUMBER=$($preReleaseVersion)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
fetch-depth: '0' | |
ref: ${{env.PRERELEASE_VERSION_NUMBER}} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Configure git | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- run: npm ci | |
- name: Install vsce | |
run: npm install -g vsce | |
- name: Increase version | |
shell: pwsh | |
run: | | |
$versionnumber = (npm version patch) | Out-String | |
echo "VERSION_NUMBER=$($versionnumber.trim())" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Package package | |
run: vsce package | |
- name : Publish git tag | |
run: git push --tags | |
continue-on-error: true | |
- name: Find filename | |
shell: pwsh | |
run: | | |
$filename = (Get-ChildItem *.vsix)[0].FullName | |
echo "PACKAGE_FILENAME=$($filename)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Publish package to VS Code Marketplace | |
env: | |
VSCEKEY: ${{secrets.VSCEKEY}} | |
run: | | |
vsce publish -p $VSCEKEY --packagePath $PACKAGE_FILENAME | |
- name: Release to GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{env.PACKAGE_FILENAME}} | |
prerelease: false | |
tag_name: ${{env.VERSION_NUMBER}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish package to Open VSX Marketplace | |
env: | |
OVSXKEY: ${{secrets.OVSXKEY}} | |
run: | | |
npx ovsx publish $PACKAGE_FILENAME -p $OVSXKEY |