Skip to content

Commit

Permalink
Merge 92561f3 into a36ea9d
Browse files Browse the repository at this point in the history
  • Loading branch information
dstenroejl authored Mar 29, 2023
2 parents a36ea9d + 92561f3 commit ee89759
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 105 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ indent_size = 2
indent_size = 2

# Powershell files
[*.ps1]
indent_size = 2
[*.{ps1, psm1, psd1}]
indent_size = 4

# Shell script files
[*.sh]
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
blank_issues_enabled: false
blank_issues_enabled: false
29 changes: 15 additions & 14 deletions .github/actions/dependabot-project-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: 'Check Dependabot projects'
description: 'Checks that dependabot.yml gets updated with any added or removed csproj files'
name: Check Dependabot projects
description: Checks that dependabot.yml gets updated with any added or removed csproj files

runs:
using: "composite"
using: composite
steps:
# Code comments for each line:
# Fetch all changed files in this PR
# Return a concatenated string containing status and filename for each object
# Search for all strings containing .csproj - return true if none are found to avoid script exiting
# Return only the directory for all strings (dirname basically just cuts off the filename at the end and doesn't care about the start of our concatenated string) and only run if grep returned any values
#
# If no files are found tell the user and exit this step
#
# Encode all line breaks
#
# Use the dirs variable as output from this step
# Code comments for each line:
# Fetch all changed files in this PR
# Return a concatenated string containing status and filename for each object
# Search for all strings containing .csproj - return true if none are found to avoid script exiting
# Return only the directory for all strings (dirname basically just cuts off the filename at the end and doesn't care about the start of our concatenated string) and only run if grep returned any values
#
# If no files are found tell the user and exit this step
#
# Encode all line breaks
#
# Use the dirs variable as output from this step
- name: Fetch csproj dirs with changes
id: fetchCsprojDirs
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/dotnet-prepare-outputs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ name: Prepare dotnet outputs
#

inputs:
OUTPUT_PATH:
output_path:
required: true

runs:
Expand All @@ -40,7 +40,7 @@ runs:
--no-build \
--no-restore \
--configuration Release \
--output '${{ inputs.OUTPUT_PATH }}\migration\databasemigration'
--output '${{ inputs.output_path }}\migration\databasemigration'
- name: Publish API
shell: bash
Expand All @@ -50,7 +50,7 @@ runs:
--no-build \
--no-restore \
--configuration Release \
--output '${{ inputs.OUTPUT_PATH }}\functions\api'
--output '${{ inputs.output_path }}\functions\api'
- name: Publish PerformanceTest
shell: bash
Expand All @@ -60,4 +60,4 @@ runs:
--no-build \
--no-restore \
--configuration Release \
--output '${{ inputs.OUTPUT_PATH }}\functions\performancetest'
--output '${{ inputs.output_path }}\functions\performancetest'
8 changes: 4 additions & 4 deletions .github/actions/dotnet-tests-prepare-outputs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: Prepare dotnet tests outputs
#

inputs:
OUTPUT_PATH:
output_path:
required: true

runs:
Expand Down Expand Up @@ -67,8 +67,8 @@ runs:
shell: bash
run: |
# Create base directory
mkdir -p '${{ inputs.OUTPUT_PATH }}/source' ';'
mkdir -p '${{ inputs.output_path }}/source' ';'
# Copy everything from source to the new directory
cp -a source/. '${{ inputs.OUTPUT_PATH }}/source'
cp -a source/. '${{ inputs.output_path }}/source'
# Remove obj-directories from artifact
find ${{ inputs.OUTPUT_PATH }}/ -type d -name 'obj' -exec rm -rf {} +
find ${{ inputs.output_path }}/ -type d -name 'obj' -exec rm -rf {} +
54 changes: 27 additions & 27 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@

version: 2
updates:
- package-ecosystem: "nuget"
directory: "/source/ApplyDBMigrationsApp"
- package-ecosystem: nuget
directory: /source/ApplyDBMigrationsApp
schedule:
interval: "monthly"
interval: monthly

- package-ecosystem: "nuget"
directory: "/source/Api"
- package-ecosystem: nuget
directory: /source/Api
schedule:
interval: "monthly"
interval: monthly

- package-ecosystem: "nuget"
directory: "/source/Application"
- package-ecosystem: nuget
directory: /source/Application
schedule:
interval: "monthly"
interval: monthly

- package-ecosystem: "nuget"
directory: "/source/ArchitectureTests"
- package-ecosystem: nuget
directory: /source/ArchitectureTests
schedule:
interval: "monthly"
interval: monthly

- package-ecosystem: "nuget"
directory: "/source/CimMessageAdapter"
- package-ecosystem: nuget
directory: /source/CimMessageAdapter
schedule:
interval: "monthly"
interval: monthly

- package-ecosystem: "nuget"
directory: "/source/CimMessageAdapter.Tests"
- package-ecosystem: nuget
directory: /source/CimMessageAdapter.Tests
schedule:
interval: "monthly"
interval: monthly

- package-ecosystem: "nuget"
directory: "/source/Infrastructure"
- package-ecosystem: nuget
directory: /source/Infrastructure
schedule:
interval: "monthly"
interval: monthly

- package-ecosystem: "nuget"
directory: "/source/IntegrationTests"
- package-ecosystem: nuget
directory: /source/IntegrationTests
schedule:
interval: "monthly"
interval: monthly

- package-ecosystem: "nuget"
directory: "/source/Tests"
- package-ecosystem: nuget
directory: /source/Tests
schedule:
interval: "monthly"
interval: monthly
24 changes: 12 additions & 12 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ jobs:
if: ${{ needs.changes.outputs.dotnet == 'true' }}
uses: Energinet-DataHub/.github/.github/workflows/dotnet-solution-ci.yml@v10
with:
SOLUTION_FILE_PATH: "source/EDI.sln"
TESTS_FILTER_EXPRESSION: "FullyQualifiedName!~LearningTests" # Filter => Skip all tests within namespace 'LearningTests'
USE_SQLLOCALDB_2019: true
ENVIRONMENT: AzureAuth
DOTNET_VERSION: 7.0.200
solution_file_path: source/EDI.sln
tests_filter_expression: FullyQualifiedName!~LearningTests # Filter => Skip all tests within namespace 'LearningTests'
use_sqllocaldb_2019: true
environment: AzureAuth
dotnet_version: 7.0.200

dotnet_promote_prerelease:
needs: changes
if: ${{ needs.changes.outputs.dotnet == 'true' }}
uses: Energinet-DataHub/.github/.github/workflows/promote-prerelease.yml@v10
with:
RELEASE_NAME_PREFIX: dotnet
release_name_prefix: dotnet

#
# Dispatch deployment request
Expand All @@ -64,10 +64,10 @@ jobs:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository: "${{ secrets.ENVIRONMENT_REPOSITORY_PATH }}"
event-type: "edi-deployment-request-domain"
client-payload: '{"domain_pr": "${{ steps.find_pull_request.outputs.pull_request_number }}"}'
token: ${{ secrets.pat_token }}
repository: ${{ secrets.environment_repository_path }}
event-type: edi-deployment-request-domain
client-payload: '{"domain_pr": "${{ steps.find_pull_request.outputs.pull_request_number }}"}' # yamllint disable-line rule:quoted-strings

#
# Send notification to teams channel if deployment dispatch failed
Expand All @@ -80,6 +80,6 @@ jobs:
contains(needs.*.result, 'failure')
uses: Energinet-DataHub/.github/.github/workflows/notify-team.yml@v10
with:
TEAM_NAME: "Batman"
SUBJECT: "Deployment dispatch failed: EDI"
team_name: Batman
subject: "Deployment dispatch failed: EDI"
secrets: inherit
79 changes: 40 additions & 39 deletions .github/workflows/ci-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ jobs:
dotnet_ci_build:
uses: Energinet-DataHub/.github/.github/workflows/dotnet-build-prerelease.yml@v10
with:
SOLUTION_FILE_PATH: "source/EDI.sln"
DOTNET_VERSION: 7.0.200
solution_file_path: source/EDI.sln
dotnet_version: 7.0.200

# Run all tests in 'IntegrationTests.dll'
integration_tests:
uses: Energinet-DataHub/.github/.github/workflows/dotnet-postbuild-test.yml@v10
with:
TESTS_DLL_FILE_PATH: '\source\IntegrationTests\bin\Release\net7.0\IntegrationTests.dll'
DOWNLOAD_ATTEMPT_LIMIT: 12
DOTNET_VERSION: 7.0.200
tests_dll_file_path: \source\IntegrationTests\bin\Release\net7.0\IntegrationTests.dll
download_attempt_limit: 12
dotnet_version: 7.0.200

# Run all tests in 'ArchitectureTests.dll'
architecture_tests:
uses: Energinet-DataHub/.github/.github/workflows/dotnet-postbuild-test.yml@v10
with:
TESTS_DLL_FILE_PATH: '\source\ArchitectureTests\bin\Release\net7.0\ArchitectureTests.dll'
DOWNLOAD_ATTEMPT_LIMIT: 12
DOTNET_VERSION: 7.0.200
tests_dll_file_path: \source\ArchitectureTests\bin\Release\net7.0\ArchitectureTests.dll
download_attempt_limit: 12
dotnet_version: 7.0.200

# Run all tests in 'Tests.dll'
tests:
uses: Energinet-DataHub/.github/.github/workflows/dotnet-postbuild-test.yml@v10
with:
TESTS_DLL_FILE_PATH: '\source\Tests\bin\Release\net7.0\Tests.dll'
DOWNLOAD_ATTEMPT_LIMIT: 12
DOTNET_VERSION: 7.0.200
tests_dll_file_path: \source\Tests\bin\Release\net7.0\Tests.dll
download_attempt_limit: 12
dotnet_version: 7.0.200

# Deploy resources for acceptance testing
deploy_acceptance_test_resources:
runs-on: ubuntu-22.04
Expand All @@ -57,44 +57,46 @@ jobs:
id-token: write
contents: read
outputs:
resourceGroup: ${{ steps.getResourceGroup.outputs.resourceGroup }}
namespaceName: ${{ steps.getServiceBusNamespace.outputs.namespaceName }}
resource_group: ${{ steps.get_resource_group.outputs.resource_group }}
namespace_name: ${{ steps.get_servicebus_namespace.outputs.namespace_name }}
steps:
- uses: actions/checkout@v3

- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_SPN_ID_OIDC }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
client-id: ${{ secrets.azure_spn_id_oidc }}
tenant-id: ${{ secrets.azure_tenant_id }}
subscription-id: ${{ secrets.azure_subscription_id }}

- id: getResourceGroup
- name: Get Resource Group
id: get_resource_group
shell: pwsh
run: |
Write-Output "resourceGroup=$(`
Write-Output "resource_group=$(`
az keyvault secret show `
--vault-name ${{ secrets.AZURE_KEYVAULT_NAME }} `
--vault-name ${{ secrets.azure_keyvault_name }} `
--name "AZURE-SHARED-RESOURCEGROUP" `
--query value -o tsv)" >> $Env:GITHUB_OUTPUT
- id: getServiceBusNamespace
--query value -o tsv)" >> $Env:GITHUB_OUTPUT
- name: Get ServiceBus Namespace
id: get_servicebus_namespace
shell: pwsh
run: Write-Output "namespaceName=$(`
run: Write-Output "namespace_name=$(`
az keyvault secret show `
--vault-name ${{ secrets.AZURE_KEYVAULT_NAME }} `
--vault-name ${{ secrets.azure_keyvault_name }} `
--name "AZURE-SERVICEBUS-NAMESPACE" `
--query value -o tsv)" >> $Env:GITHUB_OUTPUT

- name: Publish acceptance test resources
shell: pwsh
run: |
.\source\AcceptanceTests\deploy\deploy.ps1 `
-PrNumber ${{ github.event.pull_request.number }} `
-Subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} `
-ResourceGroup ${{ steps.getResourceGroup.outputs.resourceGroup }} `
-Subscription ${{ secrets.azure_subscription_id }} `
-ResourceGroup ${{ steps.get_resource_group.outputs.resource_group }} `
-SqlServerName " " `
-NamespaceName ${{ steps.getServiceBusNamespace.outputs.namespaceName }}
-NamespaceName ${{ steps.get_servicebus_namespace.outputs.namespace_name }}
# Teardown resources for acceptance testing
teardown_acceptance_test_resources:
Expand All @@ -106,21 +108,20 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v3

- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_SPN_ID_OIDC }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
client-id: ${{ secrets.azure_spn_id_oidc }}
tenant-id: ${{ secrets.azure_tenant_id }}
subscription-id: ${{ secrets.azure_subscription_id }}

- name: Teardown acceptance test resources
shell: pwsh
run: |
.\source\AcceptanceTests\deploy\teardown.ps1 `
-PrNumber ${{ github.event.pull_request.number }} `
-Subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} `
-ResourceGroup ${{ needs.deploy_acceptance_test_resources.outputs.resourceGroup }} `
-Subscription ${{ secrets.azure_subscription_id }} `
-ResourceGroup ${{ needs.deploy_acceptance_test_resources.outputs.resource_group }} `
-SqlServerName " " `
-NamespaceName ${{ needs.deploy_acceptance_test_resources.outputs.namespaceName }}
-NamespaceName ${{ needs.deploy_acceptance_test_resources.outputs.namespace_name }}
3 changes: 3 additions & 0 deletions .github/workflows/ci-orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
#
ci_base:
uses: Energinet-DataHub/.github/.github/workflows/ci-base.yml@v10
with:
skip_yaml_lint: false
skip_actions_casing_validation: false

#
# Detect changes to start relevant workflows
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@
*.userosscache
*.sln.docstates
*.idea*
.vscode/

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
Loading

0 comments on commit ee89759

Please sign in to comment.