Skip to content

Commit

Permalink
Monorepo restructuring (#647)
Browse files Browse the repository at this point in the history
Move all photon-related projects to a Photon/ filesystem directory (they
were already in a Photon solution folder).

This is in preparation for splitting up the github workflows based on
which component was edited
  • Loading branch information
SapiensAnatis authored Feb 15, 2024
1 parent 5a363dc commit c17b7f4
Show file tree
Hide file tree
Showing 1,234 changed files with 109 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .csharpierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DragaliaAPI.Database/Migrations/*
DragaliaAPI/DragaliaAPI.Database/Migrations/*
74 changes: 74 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: publish

on:
workflow_call:
inputs:
ref:
required: true
type: string
description: ref to checkout
dockerfile:
required: true
type: string
description: path to Dockerfile
image-name:
required: true
type: string
description: Docker image name
image-tag:
required: false
default: "undefined"
type: string
description: Docker image tag

env:
HUSKY: 0

jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ["8.0.x"]

steps:
- name: derive tag
id: derive-tag
run: |
TAG_REGEX="[\w]+?@v(.*)"
echo "Ref: ${{ inputs.ref }}"
echo "Tag: ${{ inputs.image-tag }}"
if [ ${{ inputs.image-tag }} != "undefined" ]
then
echo "tag=${{ inputs.image-tag }}" >> "$GITHUB_OUTPUT"
exit 0;
fi
if [ ${{ inputs.ref }} = "develop" ]
then
echo "tag=latest" >> "$GITHUB_OUTPUT"
elif [[ ${{ inputs.ref }} =~ $TAG_REGEX ]]
then
echo "tag=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
else
echo "No image-tag provided and failed to derive image tag from ref"
exit 1;
fi
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Build and push
run: |
IMAGE=ghcr.io/sapiensanatis/${{ inputs.image-name }}:${{ steps.derive-tag.outputs.tag }}
docker build . --file ${{ inputs.dockerfile }} --tag ${IMAGE} --build-arg CI=true
docker push ${IMAGE}
4 changes: 2 additions & 2 deletions .github/workflows/missiondesigner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
dotnet-version: "8.0.x"
- name: Run MissionDesigner
run: |
dotnet run --project DragaliaAPI.MissionDesigner -- NewProgressionInfo.json
cmp NewProgressionInfo.json DragaliaAPI.Shared/Resources/Missions/MissionProgressionInfo.json
dotnet run --project DragaliaAPI/DragaliaAPI.MissionDesigner -- NewProgressionInfo.json
cmp NewProgressionInfo.json DragaliaAPI/DragaliaAPI.Shared/Resources/Missions/MissionProgressionInfo.json
4 changes: 2 additions & 2 deletions .github/workflows/publish-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
args:
[
{
dockerfile: "DragaliaAPI.Photon.StateManager/Dockerfile",
dockerfile: "DragaliaAPI/DragaliaAPI.Photon.StateManager/Dockerfile",
image: "photon-state-manager",
},
{ dockerfile: "DragaliaAPI/Dockerfile", image: "dragalia-api" }
{ dockerfile: "DragaliaAPI/DragaliaAPI/Dockerfile", image: "dragalia-api" }
]
uses: ./.github/workflows/publish.yaml
with:
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
matrix:
project:
[
"DragaliaAPI.Test",
"DragaliaAPI.Integration.Test",
"DragaliaAPI.Database.Test",
"DragaliaAPI.Shared.Test",
"DragaliaAPI.Photon.StateManager.Test",
"DragaliaAPI/DragaliaAPI.Test",
"DragaliaAPI/DragaliaAPI.Integration.Test",
"DragaliaAPI/DragaliaAPI.Database.Test",
"DragaliaAPI/DragaliaAPI.Shared.Test",
"Photon/DragaliaAPI.Photon.StateManager.Test",
]

services:
Expand All @@ -49,6 +49,10 @@ jobs:
--health-retries 5
steps:
- name: Get project name # Remove folder from project
id: get-name
run: >
echo ${{ matrix.project }} | sed 's/.*\//name=/' >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
- name: Setup .NET Core SDK 7
uses: actions/setup-dotnet@v4
Expand All @@ -61,10 +65,11 @@ jobs:
dotnet test ${{ matrix.project }}
--no-restore
--logger "console;verbosity=detailed"
--logger "trx;LogFileName=${{ matrix.project }}.trx"
--logger "trx;LogFileName=${{ steps.get-name.outputs.name }}.trx"
- name: Upload test report
uses: actions/upload-artifact@v4
if: success() || failure() # run this step even if previous step failed
with:
name: test-result-${{ matrix.project }}
path: ${{ matrix.project }}/TestResults/${{ matrix.project }}.trx
name: test-result-${{ steps.get-name.outputs.name }}
path: ${{ matrix.project }}/TestResults/${{ steps.get-name.outputs.name }}.trx
29 changes: 15 additions & 14 deletions DragaliaAPI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32811.315
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI", "DragaliaAPI\DragaliaAPI.csproj", "{161BE542-C5B4-441D-BEA1-5F3553BFD839}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI", "DragaliaAPI\DragaliaAPI\DragaliaAPI.csproj", "{161BE542-C5B4-441D-BEA1-5F3553BFD839}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Test", "DragaliaAPI.Test\DragaliaAPI.Test.csproj", "{A1E6C76A-4D4F-427D-80AF-CF289CBBAF00}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Test", "DragaliaAPI\DragaliaAPI.Test\DragaliaAPI.Test.csproj", "{A1E6C76A-4D4F-427D-80AF-CF289CBBAF00}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{6E4BCC4D-1998-4135-A474-681EC6E6AF57}"
EndProject
Expand All @@ -23,13 +23,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Database", "DragaliaAPI.Database\DragaliaAPI.Database.csproj", "{3B1A86CE-A656-453B-BC3F-EA42DF9E3FC6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Database", "DragaliaAPI\DragaliaAPI.Database\DragaliaAPI.Database.csproj", "{3B1A86CE-A656-453B-BC3F-EA42DF9E3FC6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Shared", "DragaliaAPI.Shared\DragaliaAPI.Shared.csproj", "{A8051BCA-7E23-417C-986A-943DE4F81E1B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Shared", "DragaliaAPI\DragaliaAPI.Shared\DragaliaAPI.Shared.csproj", "{A8051BCA-7E23-417C-986A-943DE4F81E1B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Shared.Test", "DragaliaAPI.Shared.Test\DragaliaAPI.Shared.Test.csproj", "{283F16C6-1EB5-4062-90C6-663D975977FE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Shared.Test", "DragaliaAPI\DragaliaAPI.Shared.Test\DragaliaAPI.Shared.Test.csproj", "{283F16C6-1EB5-4062-90C6-663D975977FE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Database.Test", "DragaliaAPI.Database.Test\DragaliaAPI.Database.Test.csproj", "{BF6A04DC-56FE-491F-A73B-F54A3E7BAA4B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Database.Test", "DragaliaAPI\DragaliaAPI.Database.Test\DragaliaAPI.Database.Test.csproj", "{BF6A04DC-56FE-491F-A73B-F54A3E7BAA4B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{1A23D473-87C4-40FB-8DF0-43F4B0FE7414}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -41,31 +41,32 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{1A23D4
.github\workflows\publish-statemanager.yaml = .github\workflows\publish-statemanager.yaml
.github\workflows\publish.yaml = .github\workflows\publish.yaml
.github\workflows\test.yaml = .github\workflows\test.yaml
.github\workflows\missiondesigner.yaml = .github\workflows\missiondesigner.yaml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Test.Utils", "DragaliaAPI.Test.Utils\DragaliaAPI.Test.Utils.csproj", "{41916B7C-6304-4504-99C0-B24D23982F7E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Test.Utils", "DragaliaAPI\DragaliaAPI.Test.Utils\DragaliaAPI.Test.Utils.csproj", "{41916B7C-6304-4504-99C0-B24D23982F7E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.StateManager", "DragaliaAPI.Photon.StateManager\DragaliaAPI.Photon.StateManager.csproj", "{8E4D9C20-3914-4A8A-ACC0-22997F2947AB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.StateManager", "Photon\DragaliaAPI.Photon.StateManager\DragaliaAPI.Photon.StateManager.csproj", "{8E4D9C20-3914-4A8A-ACC0-22997F2947AB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.Plugin", "DragaliaAPI.Photon.Plugin\DragaliaAPI.Photon.Plugin.csproj", "{D9AC51A5-38F6-4DD1-8839-9FE881396A6B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.Plugin", "Photon\DragaliaAPI.Photon.Plugin\DragaliaAPI.Photon.Plugin.csproj", "{D9AC51A5-38F6-4DD1-8839-9FE881396A6B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Photon", "Photon", "{8B4B2FE9-B1FC-44FC-BC49-0E277731A68A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Integration.Test", "DragaliaAPI.Integration.Test\DragaliaAPI.Integration.Test.csproj", "{CA0AE7C5-2742-4FC9-B668-BC7459E4BCE5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Integration.Test", "DragaliaAPI\DragaliaAPI.Integration.Test\DragaliaAPI.Integration.Test.csproj", "{CA0AE7C5-2742-4FC9-B668-BC7459E4BCE5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.Shared", "DragaliaAPI.Photon.Shared\DragaliaAPI.Photon.Shared.csproj", "{7394DCE5-7E1B-44C7-B3CA-735885D97695}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.Shared", "Photon\DragaliaAPI.Photon.Shared\DragaliaAPI.Photon.Shared.csproj", "{7394DCE5-7E1B-44C7-B3CA-735885D97695}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.StateManager.Test", "DragaliaAPI.Photon.StateManager.Test\DragaliaAPI.Photon.StateManager.Test.csproj", "{D940A00F-39CC-48C5-996E-DF0EC55FD140}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.StateManager.Test", "Photon\DragaliaAPI.Photon.StateManager.Test\DragaliaAPI.Photon.StateManager.Test.csproj", "{D940A00F-39CC-48C5-996E-DF0EC55FD140}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".husky", ".husky", "{7D333F35-F74C-4A63-AB6E-5F0EE4590ADB}"
ProjectSection(SolutionItems) = preProject
.husky\pre-commit = .husky\pre-commit
.husky\task-runner.json = .husky\task-runner.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.Plugin.Test", "DragaliaAPI.Photon.Plugin.Test\DragaliaAPI.Photon.Plugin.Test.csproj", "{64D07506-1978-4981-AF90-B73C4B6AFCE5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.Plugin.Test", "Photon\DragaliaAPI.Photon.Plugin.Test\DragaliaAPI.Photon.Plugin.Test.csproj", "{64D07506-1978-4981-AF90-B73C4B6AFCE5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.MissionDesigner", "DragaliaAPI.MissionDesigner\DragaliaAPI.MissionDesigner.csproj", "{00908D51-DB79-4A9C-AFBF-501F9981E6F1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.MissionDesigner", "DragaliaAPI\DragaliaAPI.MissionDesigner\DragaliaAPI.MissionDesigner.csproj", "{00908D51-DB79-4A9C-AFBF-501F9981E6F1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c17b7f4

Please sign in to comment.