Skip to content

Commit

Permalink
Merge pull request #290 from SapiensAnatis/develop
Browse files Browse the repository at this point in the history
Develop -> master
  • Loading branch information
SapiensAnatis authored Jun 28, 2023
2 parents 860391a + b6d049b commit c217049
Show file tree
Hide file tree
Showing 557 changed files with 247,956 additions and 5,125 deletions.
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
"isRoot": true,
"tools": {
"husky": {
"version": "0.5.2",
"version": "0.5.4",
"commands": [
"husky"
]
},
"csharpier": {
"version": "0.22.1",
"version": "0.24.2",
"commands": [
"dotnet-csharpier"
]
},
"dotnet-ef": {
"version": "7.0.1",
"version": "7.0.8",
"commands": [
"dotnet-ef"
]
Expand Down
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
README.md
DragaliaAPI.Photon.Plugin/**
*.Test/**/*
5 changes: 4 additions & 1 deletion .env.default
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
POSTGRES_USER=
POSTGRES_PASSWORD=
DEVELOPER_TOKEN=
DEVELOPER_TOKEN=
REDIS_PASSWORD=
HOSTNAME=
PHOTON_TOKEN=
17 changes: 13 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
name: deploy

on:
workflow_call:
workflow_call:
inputs:
deployment:
type: string
required: true
description: "Kubernetes deployment name"
namespace:
type: string
required: true
description: "Kubernetes namespace"

jobs:
deploy:
Expand All @@ -15,6 +24,6 @@ jobs:
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script_stop: true
script: |
kubectl rollout restart deployment/dragalia-api
kubectl rollout status deployment/dragalia-api
script: |
kubectl rollout restart deployment/${{ inputs.deployment }} -n ${{ inputs.namespace }}
kubectl rollout status deployment/${{ inputs.deployment }} -n ${{ inputs.namespace }}
3 changes: 1 addition & 2 deletions .github/workflows/publish-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ env:

jobs:
publish:
uses: ./.github/workflows/publish-base.yaml
uses: ./.github/workflows/publish.yaml
with:
ref: ${{ inputs.tag }}
image-tag: ${{ inputs.tag }}
secrets: inherit

36 changes: 29 additions & 7 deletions .github/workflows/publish-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,45 @@ name: publish-push
on:
push:
branches:
- develop
paths-ignore:
- "**/*.yaml"
- "**/*.yml"
- "**/*.md"
- "develop"

env:
HUSKY: 0

jobs:
publish:
uses: ./.github/workflows/publish-base.yaml
strategy:
matrix:
args:
[
{
dockerfile: "DragaliaAPI.Photon.StateManager/Dockerfile",
image: "dragalia-api-statemanager",
},
{ dockerfile: "DragaliaAPI/Dockerfile", image: "dragalia-api" },
]
uses: ./.github/workflows/publish.yaml
with:
ref: develop
dockerfile: ${{ matrix.args.dockerfile }}
image-name: ${{ matrix.args.image }}
image-tag: latest
secrets: inherit

deploy:
strategy:
matrix:
args:
[
{
deployment: "photonstatemanager",
namespace: "photonstatemanager",
},
{ deployment: "dragalia-api-dawnshard", namespace: "dragalia-api" },
]
needs: publish
uses: ./.github/workflows/deploy.yaml
secrets: inherit
with:
deployment: ${{ matrix.args.deployment }}
namespace: ${{ matrix.args.namespace }}
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/publish-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: publish-tag
on:
push:
tags:
- "*"
- "api@*"

env:
HUSKY: 0

jobs:
publish:
uses: ./.github/workflows/publish-base.yaml
uses: ./.github/workflows/publish.yaml
with:
ref: ${{ github.ref_name }}
image-tag: ${{ github.ref_name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ on:
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: true
type: string
Expand All @@ -20,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
dotnet-version: ["7.0.x"]

steps:
- uses: actions/checkout@v3
Expand All @@ -39,6 +47,6 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
file: DragaliaAPI/Dockerfile
file: ${{ inputs.dockerfile }}
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/dragalia-api:${{ inputs.image-tag }}
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ inputs.image-name }}:${{ inputs.image-tag }}
58 changes: 49 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,69 @@ on:
branches:
- master
- develop
paths-ignore:
- "**/*.yaml"
- "**/*.yml"
- "**/*.md"

env:
HUSKY: 0
POSTGRES_USER: testing
POSTGRES_PASSWORD: verystrongpassword

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
project: ['DragaliaAPI.Test', 'DragaliaAPI.Database.Test', 'DragaliaAPI.Shared.Test']
project:
[
"DragaliaAPI.Test",
"DragaliaAPI.Integration.Test",
"DragaliaAPI.Database.Test",
"DragaliaAPI.Shared.Test",
"DragaliaAPI.Photon.StateManager.Test",
]

services:
postgres:
image: postgres
ports:
- "5432:5432"
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis/redis-stack
ports:
- "6379:6379"
options: >-
--health-cmd "redis-cli PING"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
- name: Setup .NET Core SDK 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
dotnet-version: "7.0.x"
- name: Install dependencies
run: dotnet restore ${{ matrix.project }}
- name: Test
run: dotnet test ${{ matrix.project }} --no-restore
run: >
dotnet test ${{ matrix.project }}
--no-restore
--logger "console;verbosity=detailed"
-p:CollectCoverage=true
-p:CoverletOutputFormat="cobertura"
-p:CoverletOutput="coverage_report.xml"
-p:Exclude=\"[*.Test]*,[DragaliaAPI.Test.Utils]*,[DragaliaAPI.Photon.Plugin]*,[DragaliaAPI.Database]DragaliaAPI.Database.Migrations.*,[DragaliaAPI]DragaliaAPI.Models.Generated.*\"
- name: Upload coverage reports
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.project }} coverage report
path: ${{ matrix.project }}/coverage_report.xml
retention-days: 2
52 changes: 9 additions & 43 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,47 +1,12 @@
.idea
.run
.env
*/**/launchSettings.json
*/**/appsettings.Development.json
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
test_coverage.json
launchSettings.json
appsettings.Development.json
test_coverage.json
.run
PhotonServer

# CMake
cmake-build-*/
Expand Down Expand Up @@ -116,6 +81,7 @@ bld/

# Visual Studio 2015/2017 cache/options directory
.vs/
.vscode/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

Expand Down
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
13 changes: 0 additions & 13 deletions .idea/.idea.DragaliaAPI/.idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .idea/.idea.DragaliaAPI/.idea/.name

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/.idea.DragaliaAPI/.idea/CSharpierPlugin.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/.idea.DragaliaAPI/.idea/encodings.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/.idea.DragaliaAPI/.idea/indexLayout.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/.idea.DragaliaAPI/.idea/vcs.xml

This file was deleted.

Loading

0 comments on commit c217049

Please sign in to comment.