Merge pull request #73 from sgmunn/ci-building

CI GitHub action
This commit is contained in:
Miguel de Icaza 2020-04-20 08:34:38 -04:00 коммит произвёл GitHub
Родитель 6dfe1f5c2a af2a292a27
Коммит 04ab7d633e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 54 добавлений и 24 удалений

39
.github/workflows/build-and-test.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,39 @@
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# 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: macos-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@v2
# Build helper
- name: Build ptylib
run: |
cd helper
cc -shared pty.c -shared -o libpty.dylib
# Restore packages
- name: Restore
run: msbuild /t:restore
# Build
- name: Build
run: msbuild /t:build
# Test
- name: Test
run: dotnet test Tests/Tests.csproj

Просмотреть файл

@ -31,17 +31,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="NStack">
<HintPath>..\packages\NStack.Core.0.12.0\lib\netstandard1.5\NStack.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="Terminal.Gui">
<HintPath>..\packages\Terminal.Gui.0.19.0\lib\net461\Terminal.Gui.dll</HintPath>
</Reference>
<Reference Include="Mono.Posix" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="NStack.Core" Version="0.12.0" />
<PackageReference Include="Terminal.Gui" Version="0.19.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />

Просмотреть файл

@ -263,7 +263,7 @@ namespace GuiCsHost {
public override bool MouseEvent (MouseEvent mouseEvent)
{
if (terminal.MouseEvents) {
if (terminal.MouseMode.SendMotionEvent()) {
var f = mouseEvent.Flags;
int button = -1;
if (f.HasFlag (MouseFlags.Button1Clicked))
@ -274,10 +274,10 @@ namespace GuiCsHost {
button = 2;
if (button != -1){
var e = terminal.EncodeButton (button, release: false, shift: false, meta: false, control: false);
var e = terminal.EncodeMouseButton (button, release: false, shift: false, meta: false, control: false);
terminal.SendEvent (e, mouseEvent.X, mouseEvent.Y);
if (terminal.MouseSendsRelease) {
e = terminal.EncodeButton (button, release: true, shift: false, meta: false, control: false);
if (terminal.MouseMode.SendButtonRelease()) {
e = terminal.EncodeMouseButton (button, release: true, shift: false, meta: false, control: false);
terminal.SendEvent (e, mouseEvent.X, mouseEvent.Y);
}
return true;
@ -325,6 +325,11 @@ namespace GuiCsHost {
return null;
}
bool ITerminalDelegate.IsProcessTrusted ()
{
return true;
}
public override void PositionCursor ()
{
Move (terminal.Buffer.X, terminal.Buffer.Y);

Просмотреть файл

@ -28,9 +28,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="NStack">
<HintPath>..\packages\NStack.Core.0.11.0\lib\netstandard1.5\NStack.dll</HintPath>
</Reference>
<PackageReference Include="NStack.Core" Version="0.12.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Просмотреть файл

@ -0,0 +1 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute ("Tests")]

Просмотреть файл

@ -21,10 +21,4 @@
<ItemGroup>
<Compile Remove="Renderer.cs" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute" Visible="False">
<_Parameter1>Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>