Skip to content

Commit 1f5a606

Browse files
authored
Merge pull request #3 from shader-ls/test/basic
test: Add basic CI test
2 parents d824ebb + dd7264c commit 1f5a606

File tree

10 files changed

+37
-122
lines changed

10 files changed

+37
-122
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: 'github-actions'
5+
directory: '/'
6+
schedule:
7+
interval: 'daily'

.github/workflows/test.yml

Lines changed: 12 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,42 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
6-
# This workflow will build, test, sign and package a WPF or Windows Forms desktop application
7-
# built on .NET Core.
8-
# To learn how to migrate your existing application to .NET Core,
9-
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
10-
#
11-
# To configure this workflow:
12-
#
13-
# 1. Configure environment variables
14-
# GitHub sets default environment variables for every workflow run.
15-
# Replace the variables relative to your project in the "env" section below.
16-
#
17-
# 2. Signing
18-
# Generate a signing certificate in the Windows Application
19-
# Packaging Project or add an existing signing certificate to the project.
20-
# Next, use PowerShell to encode the .pfx file using Base64 encoding
21-
# by running the following Powershell script to generate the output string:
22-
#
23-
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
24-
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
25-
#
26-
# Open the output file, SigningCertificate_Encoded.txt, and copy the
27-
# string inside. Then, add the string to the repo as a GitHub secret
28-
# and name it "Base64_Encoded_Pfx."
29-
# For more information on how to configure your signing certificate for
30-
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
31-
#
32-
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
33-
# See "Build the Windows Application Packaging project" below to see how the secret is used.
34-
#
35-
# For more information on GitHub Actions, refer to https://github.com/features/actions
36-
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
37-
# refer to https://github.com/microsoft/github-actions-for-desktop-apps
38-
39-
name: .NET Core Desktop
1+
name: Build
402

413
on:
424
push:
435
branches: [ "master" ]
446
pull_request:
457
branches: [ "master" ]
8+
workflow_dispatch:
469

47-
jobs:
10+
env:
11+
Solution_Name: shader-ls.sln
4812

13+
jobs:
4914
build:
50-
5115
strategy:
16+
fail-fast: false
5217
matrix:
5318
configuration: [Debug, Release]
5419

55-
runs-on: windows-latest # For a list of available runner types, refer to
56-
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
57-
58-
env:
59-
Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln.
60-
Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
61-
Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
62-
Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
20+
runs-on: windows-latest
6321

6422
steps:
65-
- name: Checkout
66-
uses: actions/checkout@v3
67-
with:
68-
fetch-depth: 0
23+
- uses: actions/checkout@v3
6924

7025
# Install the .NET Core workload
7126
- name: Install .NET Core
7227
uses: actions/setup-dotnet@v3
7328
with:
7429
dotnet-version: 6.0.x
7530

76-
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
7731
- name: Setup MSBuild.exe
7832
uses: microsoft/[email protected]
7933

80-
# Execute all unit tests in the solution
8134
- name: Execute unit tests
35+
working-directory: Server
8236
run: dotnet test
8337

84-
# Restore the application to populate the obj folder with RuntimeIdentifiers
85-
- name: Restore the application
86-
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
38+
- name: Build the application
39+
working-directory: Server
40+
run: msbuild $env:Solution_Name /t:Rebuild /p:Configuration=$env:Configuration
8741
env:
8842
Configuration: ${{ matrix.configuration }}
89-
90-
# Decode the base 64 encoded pfx and save the Signing_Certificate
91-
- name: Decode the pfx
92-
run: |
93-
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
94-
$certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx
95-
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
96-
97-
# Create the app package by building and packaging the Windows Application Packaging project
98-
- name: Create the app package
99-
run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
100-
env:
101-
Appx_Bundle: Always
102-
Appx_Bundle_Platforms: x86|x64
103-
Appx_Package_Build_Mode: StoreUpload
104-
Configuration: ${{ matrix.configuration }}
105-
106-
# Remove the pfx
107-
- name: Remove the pfx
108-
run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx
109-
110-
# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
111-
- name: Upload build artifacts
112-
uses: actions/upload-artifact@v3
113-
with:
114-
name: MSIX Package
115-
path: ${{ env.Wap_Project_Directory }}\AppPackages

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# shader-language-server
88
> Language server implementation for ShaderLab
99
10+
[![Build](https://github.com/shader-ls/shader-language-server/actions/workflows/test.yml/badge.svg)](https://github.com/shader-ls/shader-language-server/actions/workflows/test.yml)
11+
1012
## 🚧 Status
1113

1214
Still in development.

Server/Handlers/SignatureHelpHandler.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
using System.Linq;
2-
using System.Security.Cryptography.Xml;
3-
using System.Text.RegularExpressions;
1+
using System.Text.RegularExpressions;
42
using Microsoft.Extensions.Logging;
53
using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities;
64
using OmniSharp.Extensions.LanguageServer.Protocol.Document;
75
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
86
using OmniSharp.Extensions.LanguageServer.Protocol.Server;
97
using ShaderlabVS.Data;
108
using ShaderLS.Management;
11-
using static System.Net.Mime.MediaTypeNames;
129

1310
namespace ShaderLS.Handlers
1411
{

Server/ShaderlabVS.Data/Attributes.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace ShaderlabVS.Data
1+
namespace ShaderlabVS.Data
42
{
53
[AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
64
sealed class DefinationKeyAttribute : Attribute

Server/ShaderlabVS.Data/DefinationDataProvider.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Reflection;
1+
using System.Reflection;
52

63
namespace ShaderlabVS.Data
74
{

Server/ShaderlabVS.Data/DefinationReader.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Collections.Generic;
2-
using System.IO;
3-
using System.Text;
1+
using System.Text;
42
using System.Text.RegularExpressions;
53

64
namespace ShaderlabVS.Data

Server/ShaderlabVS.Data/Models.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
5-
namespace ShaderlabVS.Data
1+
namespace ShaderlabVS.Data
62
{
73
#region Common
84
public class ModelBase

Server/ShaderlabVS.Data/ShaderlabDataManager.cs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Diagnostics.Eventing.Reader;
4-
using System.IO;
5-
using System.Linq;
6-
using System.Reflection;
1+
using System.Reflection;
72

83
namespace ShaderlabVS.Data
94
{
@@ -13,15 +8,15 @@ namespace ShaderlabVS.Data
138
public class ShaderlabDataManager
149
{
1510
#region Constants
16-
public static string HLSL_CG_DATATYPE_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "HLSL_CG_datatype.def";
17-
public static string HLSL_CG_FUNCTION_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "HLSL_CG_functions.def";
18-
public static string HLSL_CG_KEYWORD_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "HLSL_CG_Keywords.def";
19-
20-
public static string UNITY3D_DATATYPE_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_datatype.def";
21-
public static string UNITY3D_FUNCTION_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_functions.def";
22-
public static string UNITY3D_KEYWORD_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_keywords.def";
23-
public static string UNITY3D_MACROS_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_macros.def";
24-
public static string UNITY3D_VALUES_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_values.def";
11+
public static string HLSL_CG_DATATYPE_DEFINATIONFILE = Path.Combine("Data", "HLSL_CG_datatype.def");
12+
public static string HLSL_CG_FUNCTION_DEFINATIONFILE = Path.Combine("Data", "HLSL_CG_functions.def");
13+
public static string HLSL_CG_KEYWORD_DEFINATIONFILE = Path.Combine("Data", "HLSL_CG_Keywords.def");
14+
15+
public static string UNITY3D_DATATYPE_DEFINATIONFILE = Path.Combine("Data", "Unity3D_datatype.def");
16+
public static string UNITY3D_FUNCTION_DEFINATIONFILE = Path.Combine("Data", "Unity3D_functions.def");
17+
public static string UNITY3D_KEYWORD_DEFINATIONFILE = Path.Combine("Data", "Unity3D_keywords.def");
18+
public static string UNITY3D_MACROS_DEFINATIONFILE = Path.Combine("Data", "Unity3D_macros.def");
19+
public static string UNITY3D_VALUES_DEFINATIONFILE = Path.Combine("Data", "Unity3D_values.def");
2520
#endregion
2621

2722
#region Properties

Server/ShaderlabVS/Utilities.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace ShaderlabVS
1+
namespace ShaderlabVS
42
{
53
internal class Utilities
64
{

0 commit comments

Comments
 (0)