From 1bdd85bad67355c39fc51f9a53b2cef238b4fd44 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Thu, 25 Jan 2024 14:32:54 +0000 Subject: [PATCH 1/7] Create dotnet.yml CI pipeline to build and run unit test. --- .github/workflows/dotnet.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 00000000..44b54b81 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,28 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: windows-2019 + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal From ae226ff38d9ffa4fb2dbe028241bbb85f7979951 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Thu, 25 Jan 2024 14:40:19 +0000 Subject: [PATCH 2/7] Update dotnet.yml - Change dotnet version to 8.0 - steps should run in src sub folder --- .github/workflows/dotnet.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 44b54b81..d21306f1 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,7 +1,7 @@ # This workflow will build a .NET project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net -name: .NET +name: CI on: push: @@ -19,10 +19,16 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore dependencies - run: dotnet restore + run: | + cd src + dotnet restore - name: Build - run: dotnet build --no-restore + run: | + cd src + dotnet build --no-restore - name: Test - run: dotnet test --no-build --verbosity normal + run: | + cd src + dotnet test --no-build --verbosity normal From f527318a28577ab7a84f0f257620628af216d8aa Mon Sep 17 00:00:00 2001 From: bounav Date: Thu, 25 Jan 2024 14:56:15 +0000 Subject: [PATCH 3/7] Renamed dotnet.yml to ci.ci.yml - Added solution filter to exclude Spark.JsTests from CI build --- .github/workflows/{dotnet.yml => ci.yml} | 2 +- src/Spark.sln | 1 + src/spark-ci.slnf | 27 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) rename .github/workflows/{dotnet.yml => ci.yml} (93%) create mode 100644 src/spark-ci.slnf diff --git a/.github/workflows/dotnet.yml b/.github/workflows/ci.yml similarity index 93% rename from .github/workflows/dotnet.yml rename to .github/workflows/ci.yml index d21306f1..177cedce 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: Build run: | cd src - dotnet build --no-restore + dotnet build --no-restore spark-ci.slnf - name: Test run: | cd src diff --git a/src/Spark.sln b/src/Spark.sln index 5582e2f7..d0444fab 100644 --- a/src/Spark.sln +++ b/src/Spark.sln @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Castle MonoRail", "Castle M EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B23DD51D-925A-4488-ABE8-F2A9D69E5976}" ProjectSection(SolutionItems) = preProject + ..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml Directory.Build.props = Directory.Build.props Settings.StyleCop = Settings.StyleCop ..\spark.build = ..\spark.build diff --git a/src/spark-ci.slnf b/src/spark-ci.slnf new file mode 100644 index 00000000..826d65f1 --- /dev/null +++ b/src/spark-ci.slnf @@ -0,0 +1,27 @@ +{ + "solution": { + "path": "Spark.sln", + "projects": [ + "Castle.MonoRail.Views.Spark.Tests\\Castle.MonoRail.Views.Spark.Tests.csproj", + "Castle.MonoRail.Views.Spark\\Castle.MonoRail.Views.Spark.csproj", + "Castle.Monorail.Pdf.Tests\\Castle.MonoRail.Pdf.Tests.csproj", + "Castle.Monorail.Pdf\\Castle.MonoRail.Pdf.csproj", + "Spark.Python.Tests\\Spark.Python.Tests.csproj", + "Spark.Python\\Spark.Python.csproj", + "Spark.Ruby.Tests\\Spark.Ruby.Tests.csproj", + "Spark.Ruby\\Spark.Ruby.csproj", + "Spark.Tests\\Spark.Tests.csproj", + "Spark.Web.Mvc.Pdf.Tests\\Spark.Web.Mvc.Pdf.Tests.csproj", + "Spark.Web.Mvc.Pdf\\Spark.Web.Mvc.Pdf.csproj", + "Spark.Web.Mvc.Python\\Spark.Web.Mvc.Python.csproj", + "Spark.Web.Mvc.Ruby.Tests\\Spark.Web.Mvc.Ruby.Tests.csproj", + "Spark.Web.Mvc.Ruby\\Spark.Web.Mvc.Ruby.csproj", + "Spark.Web.Mvc.Tests\\Spark.Web.Mvc.Tests.csproj", + "Spark.Web.Mvc\\Spark.Web.Mvc.csproj", + "Spark.Web.Tests\\Spark.Web.Tests.csproj", + "Spark.Web\\Spark.Web.csproj", + "Spark\\Spark.csproj", + "Xpark\\Xpark.csproj" + ] + } +} \ No newline at end of file From 9eec4988b69cd40c28061dc264cbd24ebea2fbc6 Mon Sep 17 00:00:00 2001 From: bounav Date: Thu, 25 Jan 2024 15:00:24 +0000 Subject: [PATCH 4/7] Not sure why we need the using System; --- src/Spark/Compiler/VisualBasic/VisualBasicViewCompiler.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Spark/Compiler/VisualBasic/VisualBasicViewCompiler.cs b/src/Spark/Compiler/VisualBasic/VisualBasicViewCompiler.cs index 8f1233d4..224748d8 100644 --- a/src/Spark/Compiler/VisualBasic/VisualBasicViewCompiler.cs +++ b/src/Spark/Compiler/VisualBasic/VisualBasicViewCompiler.cs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // +using System; using System.Collections.Generic; using System.IO; using System.Linq; From c017e6b6997fcdab648e6fd7db83a2f90a933b87 Mon Sep 17 00:00:00 2001 From: bounav Date: Thu, 25 Jan 2024 15:18:47 +0000 Subject: [PATCH 5/7] Reverted line that shouldn't have been committed --- src/Spark.Web.Tests/Compiler/CSharpViewCompilerTester.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Spark.Web.Tests/Compiler/CSharpViewCompilerTester.cs b/src/Spark.Web.Tests/Compiler/CSharpViewCompilerTester.cs index 2a8afc86..2c55bd45 100644 --- a/src/Spark.Web.Tests/Compiler/CSharpViewCompilerTester.cs +++ b/src/Spark.Web.Tests/Compiler/CSharpViewCompilerTester.cs @@ -164,7 +164,7 @@ public void ProvideFullException() { new SendExpressionChunk { Code = "NoSuchVariable" } }), - Throws.TypeOf().Or.TypeOf()); + Throws.TypeOf()); } [Test] From a22a52f0ccda018499a52a8d19d9776378f9c6a0 Mon Sep 17 00:00:00 2001 From: bounav Date: Thu, 25 Jan 2024 15:24:52 +0000 Subject: [PATCH 6/7] Added solution filtering to restore and test steps --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 177cedce..c0e26b4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Restore dependencies run: | cd src - dotnet restore + dotnet restore spark-ci.slnf - name: Build run: | cd src @@ -31,4 +31,4 @@ jobs: - name: Test run: | cd src - dotnet test --no-build --verbosity normal + dotnet test --no-build --verbosity normal spark-ci.slnf From dbce157a52ae7c5b6b3c43a4eafed169bf1c31d0 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Thu, 25 Jan 2024 15:29:28 +0000 Subject: [PATCH 7/7] Update README.md Added github action status icon. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 944c3604..27d20729 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ else It's as easy as `PM> Install-Package Spark` from [nuget](http://nuget.org/packages/Spark) for the core +![Continuous Integration Status](https://github.com/SparkViewEngine/spark/actions/workflows/ci.yml/badge.svg) + ### Need Help * [Google Group](https://groups.google.com/forum/?fromgroups=#!forum/spark-dev)