From beed379190e0ebf1dfa2b1457493741c624d6f78 Mon Sep 17 00:00:00 2001 From: Hamlet Tanyavong <34531738+HamletTanyavong@users.noreply.github.com> Date: Thu, 19 Oct 2023 05:41:30 -0500 Subject: [PATCH 1/3] Add project for renderer - Add project references --- Mathematics.NET.sln | 7 +++++++ .../Mathematics.NET.DevApp.csproj | 1 + .../Mathematics.NET.Renderer.csproj | 14 ++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 src/Mathematics.NET.Renderer/Mathematics.NET.Renderer.csproj diff --git a/Mathematics.NET.sln b/Mathematics.NET.sln index eb27b767..f15301bf 100644 --- a/Mathematics.NET.sln +++ b/Mathematics.NET.sln @@ -34,6 +34,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mathematics.NET.DevApp", "src\Mathematics.NET.DevApp\Mathematics.NET.DevApp.csproj", "{89C3482F-0027-483E-AAD7-5E12453915B3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mathematics.NET.Renderer", "src\Mathematics.NET.Renderer\Mathematics.NET.Renderer.csproj", "{94744B01-DD3C-4623-992F-19C5CC2B475B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -60,6 +62,10 @@ Global {89C3482F-0027-483E-AAD7-5E12453915B3}.Debug|x64.Build.0 = Debug|x64 {89C3482F-0027-483E-AAD7-5E12453915B3}.Release|x64.ActiveCfg = Release|x64 {89C3482F-0027-483E-AAD7-5E12453915B3}.Release|x64.Build.0 = Release|x64 + {94744B01-DD3C-4623-992F-19C5CC2B475B}.Debug|x64.ActiveCfg = Debug|x64 + {94744B01-DD3C-4623-992F-19C5CC2B475B}.Debug|x64.Build.0 = Debug|x64 + {94744B01-DD3C-4623-992F-19C5CC2B475B}.Release|x64.ActiveCfg = Release|x64 + {94744B01-DD3C-4623-992F-19C5CC2B475B}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -71,6 +77,7 @@ Global {DD2741ED-C10C-4D76-8CEB-C378F3626D0D} = {91DB0FE7-BAA4-4D16-8A39-65332DD53662} {1B32D7FF-257B-49BB-B495-D64E5E6C4C82} = {9EB26D49-7E18-4404-BDCB-D26B827C4A22} {89C3482F-0027-483E-AAD7-5E12453915B3} = {DAD16084-D255-4DF4-A20D-077E92B88EC5} + {94744B01-DD3C-4623-992F-19C5CC2B475B} = {DAD16084-D255-4DF4-A20D-077E92B88EC5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {179D9282-B1D9-42EC-A6A0-C1970012ED73} diff --git a/src/Mathematics.NET.DevApp/Mathematics.NET.DevApp.csproj b/src/Mathematics.NET.DevApp/Mathematics.NET.DevApp.csproj index db52578b..a3b89346 100644 --- a/src/Mathematics.NET.DevApp/Mathematics.NET.DevApp.csproj +++ b/src/Mathematics.NET.DevApp/Mathematics.NET.DevApp.csproj @@ -9,6 +9,7 @@ + diff --git a/src/Mathematics.NET.Renderer/Mathematics.NET.Renderer.csproj b/src/Mathematics.NET.Renderer/Mathematics.NET.Renderer.csproj new file mode 100644 index 00000000..359b88bb --- /dev/null +++ b/src/Mathematics.NET.Renderer/Mathematics.NET.Renderer.csproj @@ -0,0 +1,14 @@ + + + + net7.0 + enable + enable + x64 + + + + + + + From db5687654f10615b995333798bdf9df40edbfc53 Mon Sep 17 00:00:00 2001 From: Hamlet Tanyavong <34531738+HamletTanyavong@users.noreply.github.com> Date: Sat, 21 Oct 2023 23:40:58 -0500 Subject: [PATCH 2/3] Add workflow file - Add workflow to check that the only branch that can merge to main is dev --- .github/workflows/branch-enforcer.yml | 16 ++++++++++++++++ Mathematics.NET.sln | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/branch-enforcer.yml diff --git a/.github/workflows/branch-enforcer.yml b/.github/workflows/branch-enforcer.yml new file mode 100644 index 00000000..6e7b2caa --- /dev/null +++ b/.github/workflows/branch-enforcer.yml @@ -0,0 +1,16 @@ +# Check that the only branch that can merge to "main" is "dev" + +name: "Check Branch" + +on: + pull_request: + +jobs: + check_branch: + runs-on: ubuntu-latest + steps: + - name: Check branch + if: github.base_ref == 'main' && github.head_ref != 'dev' + run: | + echo "ERROR: Can only merge to main branch from dev branch" + exit 1 diff --git a/Mathematics.NET.sln b/Mathematics.NET.sln index f15301bf..907ab674 100644 --- a/Mathematics.NET.sln +++ b/Mathematics.NET.sln @@ -28,13 +28,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{9EB2 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{1B32D7FF-257B-49BB-B495-D64E5E6C4C82}" ProjectSection(SolutionItems) = preProject + branch-enforcer.yml = branch-enforcer.yml .github\workflows\codeql.yml = .github\workflows\codeql.yml .github\workflows\generate-documentation-site.yml = .github\workflows\generate-documentation-site.yml EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mathematics.NET.DevApp", "src\Mathematics.NET.DevApp\Mathematics.NET.DevApp.csproj", "{89C3482F-0027-483E-AAD7-5E12453915B3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mathematics.NET.Renderer", "src\Mathematics.NET.Renderer\Mathematics.NET.Renderer.csproj", "{94744B01-DD3C-4623-992F-19C5CC2B475B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mathematics.NET.Renderer", "src\Mathematics.NET.Renderer\Mathematics.NET.Renderer.csproj", "{94744B01-DD3C-4623-992F-19C5CC2B475B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From 0c3f949e68b15faa12b01cdffb52b2b733dd1c8e Mon Sep 17 00:00:00 2001 From: Hamlet Tanyavong <34531738+HamletTanyavong@users.noreply.github.com> Date: Sat, 21 Oct 2023 23:56:01 -0500 Subject: [PATCH 3/3] Update .gitignore - ignore all files that are not the project file or Program.cs --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9bad20a3..f6d8b99b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,8 @@ ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore # Manually-added items -/src/Mathematics.NET.DevApp/*.cs +/src/Mathematics.NET.DevApp/* +!/src/Mathematics.NET.DevApp/Mathematics.NET.DevApp.csproj !/src/Mathematics.NET.DevApp/Program.cs *.runsettings