Skip to content

experiment: ensure gha workflow changes work #90

experiment: ensure gha workflow changes work

experiment: ensure gha workflow changes work #90

name: Contextive VSCode Extension
on:
push:
paths:
- '**LanguageServer**'
- '**vscode**'
- '**Core**'
- '.github/**vscode**'
env:
dotnet-version: '7.0.x'
# Uncomment this to ensure the vscode extension tests run in debug mode using `dotnet run` for enhanced logging
# by default we test with the release mode built binary to ensure .NET trimming hasn't broken anything
# See https://github.com/dev-cycles/contextive/issues/61 for details
# CONTEXTIVE_DEBUG: true
jobs:
build-and-test:
name: 'Build and Test'
strategy:
matrix:
include:
- dotnet_runtime: win-x64
vsce_platform: win32-x64
os: windows-latest
- dotnet_runtime: linux-x64
vsce_platform: linux-x64
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
with:
persist-credentials: false
- run: echo "πŸ’‘ The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "πŸ–₯️ The workflow is now ready to test your code on the runner."
- name: Setup .NET Core SDK ${{ env.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Display dotnet version
run: dotnet --version
- name: Install Fable
run: dotnet tool install fable --global
- name: Install paket
run: dotnet tool install paket --global
- name: Restore paket dependencies
run: paket restore
working-directory: ./src
- name: Build and Test Core
run: |
dotnet test ./src/core/Contextive.Core.Tests/Contextive.Core.Tests.fsproj --logger "trx;LogFileName=TestResults.Core-${{ env.dotnet-version }}-${{ runner.os }}.xml" -- Expecto.fail-on-focused-tests=true
- name: Build and Test Language Server
run: |
dotnet test ./src/language-server/Contextive.LanguageServer.Tests/Contextive.LanguageServer.Tests.fsproj --logger "trx;LogFileName=TestResults.LanguageServer-${{ env.dotnet-version }}-${{ runner.os }}.xml" -- Expecto.fail-on-focused-tests=true
- name: Upload Language Server Test Results
uses: actions/upload-artifact@v3
with:
name: language-server-results-${{ env.dotnet-version }}-${{ runner.os }}
path: "src/**/Contextive.*.Tests/TestResults/TestResults.*-${{ env.dotnet-version }}-${{ runner.os }}.xml"
if: always()
- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: Language Server Tests ${{ runner.os }}
path: "src/**/Contextive.*.Tests/TestResults/TestResults.*-${{ env.dotnet-version }}-${{ runner.os }}.xml"
reporter: dotnet-trx
- name: Build Release Mode/Publish Language Server
working-directory: ./src/language-server/Contextive.LanguageServer
run: |
dotnet publish -c Release -r ${{ matrix.dotnet_runtime }} -o publish
- name: Check Published Version
if: runner.os == 'Linux'
working-directory: ./src/language-server/Contextive.LanguageServer/publish
run: |
set +e
timeout -v 2 ./Contextive.LanguageServer
[ $? -eq 124 ]
- name: Restore npm dependencies
run: npm install
working-directory: ./src/vscode/contextive
if: runner.os == 'Linux'
- run: echo "🍏 This job's status is ${{ job.status }}."
- name: Start xvfb
run: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
if: runner.os == 'Linux'
- name: Copy Published Language Server to VsCode Extension
run: |
cp src/language-server/Contextive.LanguageServer/publish/Contextive.LanguageServer src/vscode/contextive/dist
- name: Build and Test VsCode Extension
run: npm test
working-directory: ./src/vscode/contextive
env:
DISPLAY: ":99.0"
DOTNET_VERSION: ${{ env.dotnet-version }}
if: runner.os == 'Linux'
- name: Upload VsCode Extension Test Results
uses: actions/upload-artifact@v3
with:
name: vscode-extension-test-results-${{ env.dotnet-version }}-${{ runner.os }}
path: "src/vscode/**/TestResults-*-${{ env.dotnet-version }}-${{ runner.os }}.xml"
if: always() && runner.os == 'Linux'
- name: Upload All Test Logs
uses: actions/upload-artifact@v3
with:
name: vscode-extension-logs-${{ env.dotnet-version }}-${{ runner.os }}
path: "**/log*.txt"
if: always() && runner.os == 'Linux'
- name: Test Report
uses: dorny/test-reporter@v1
if: always() && runner.os == 'Linux'
with:
name: VsCode Extension Tests ${{ runner.os }}
path: "src/vscode/**/TestResults-*-${{ env.dotnet-version }}-${{ runner.os }}.xml"
reporter: java-junit
- run: echo "🍏 This job's status is ${{ job.status }}."