Skip to content

Commit 60c2801

Browse files
authored
🧙‍♂️Initial Project Setup (#1)
1 parent dade5b7 commit 60c2801

22 files changed

Lines changed: 439 additions & 0 deletions

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "nuget" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
# Maintain dependencies for GitHub Actions
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"
17+
- package-ecosystem: "docker"
18+
directory: "/"
19+
schedule:
20+
interval: "weekly"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Prevent ByteOrderMarks
2+
3+
on:
4+
pull_request: {}
5+
6+
jobs:
7+
bom-check:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: arma-actions/bom-check@v1
12+
name: Check for BOM

.github/workflows/codeql.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [develop, master]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [develop]
20+
schedule:
21+
- cron: "22 4 * * 1"
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ["csharp"]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37+
# Learn more:
38+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
44+
- name: Setup .NET Core
45+
uses: actions/setup-dotnet@v4
46+
with:
47+
dotnet-version: 6.0.300
48+
49+
# Initializes the CodeQL tools for scanning.
50+
- name: Initialize CodeQL
51+
uses: github/codeql-action/init@v3
52+
with:
53+
languages: ${{ matrix.language }}
54+
# If you wish to specify custom queries, you can do so here or in a config file.
55+
# By default, queries listed here will override any specified in a config file.
56+
# Prefix the list here with "+" to use these queries and those in the config file.
57+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
58+
59+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
60+
# If this step fails, then you should remove it and run the build manually (see below)
61+
- name: Autobuild
62+
uses: github/codeql-action/autobuild@v3
63+
64+
# ℹ️ Command-line programs to run using the OS shell.
65+
# 📚 https://git.io/JvXDl
66+
67+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
68+
# and modify them (or add more) to build your code if your project
69+
# uses a compiled language
70+
71+
#- run: |
72+
# make bootstrap
73+
# make release
74+
75+
- name: Perform CodeQL Analysis
76+
uses: github/codeql-action/analyze@v3
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Dependabot auto-approve / -merge
2+
on: pull_request
3+
4+
jobs:
5+
dependabot:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
runs-on: ubuntu-latest
10+
env:
11+
PR_URL: ${{github.event.pull_request.html_url}}
12+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
13+
if: ${{ github.actor == 'dependabot[bot]' }}
14+
steps:
15+
- name: Approve a PR
16+
run: gh pr review --approve "$PR_URL"
17+
- name: Enable auto-merge for Dependabot PRs
18+
run: gh pr merge --auto --squash "$PR_URL"

.github/workflows/formatter.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: dotnet-format
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
format:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Setup .NET
11+
uses: actions/setup-dotnet@v4
12+
with:
13+
dotnet-version: 8.0.100
14+
- name: Install dotnet-format
15+
run: |
16+
dotnet tool install -g dotnet-format
17+
- name: Run dotnet-format
18+
working-directory: ./TransformerBeeClient
19+
run: dotnet-format TransformerBeeClient.sln --check
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Integration Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest]
14+
dotnet-version: ["6.0.201", "7.0.100", "8.0.100"]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup .NET Core
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: ${{ matrix.dotnet-version }}
24+
25+
- name: Log into registry
26+
# GHCR_PAT is a personal access token for the Github Container Registry; You can create it using the following steps:
27+
# 1) Go to https://github.com/settings/tokens
28+
# 2) Create a new token (classic as of 2024-01-31)
29+
# 3) Select the following scopes: read:packages
30+
# GHCR_USR is the username for the Github Container Registry; it has to match the PAT and is the username of the Github account that created the PAT
31+
# You can update the tokens in the repository settings:
32+
# https://github.com/Hochfrequenz/transformer.bee_client.net/settings/secrets/actions/GHCR_PAT
33+
# https://github.com/Hochfrequenz/transformer.bee_client.net/settings/secrets/actions/GHCR_USR
34+
# Tokens will expire 2025-01-31
35+
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ secrets.GHCR_USR }} --password-stdin
36+
- name: Start containers
37+
run: docker-compose -f "TransformerBeeClient/TransformerBeeClient.IntegrationTest/docker-compose.yml" up -d
38+
39+
- name: Install dependencies
40+
working-directory: TransformerBeeClient
41+
run: dotnet restore TransformerBeeClient.sln
42+
43+
- name: Build
44+
working-directory: TransformerBeeClient
45+
run: dotnet build --no-restore
46+
47+
- name: Run Integration Tests
48+
working-directory: TransformerBeeClient/TransformerBeeClient.IntegrationTest
49+
run: |
50+
dotnet test

.github/workflows/unittests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: [main]
8+
jobs:
9+
test:
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest]
13+
dotnet-version: ["6.0.201", "7.0.100", "8.0.100"]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup .NET Core
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: ${{ matrix.dotnet-version }}
23+
24+
- name: Install dependencies
25+
working-directory: TransformerBeeClient
26+
run: dotnet restore TransformerBeeClient.sln
27+
28+
- name: Build
29+
working-directory: TransformerBeeClient
30+
run: dotnet build --no-restore
31+
32+
- name: Run Unit Tests
33+
working-directory: TransformerBeeClient/TransformerBeeClient.UnitTest
34+
run: |
35+
dotnet test

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# transformer.bee Client (.NET)
2+
3+
This library is a .NET HTTP client for transformer.bee aka edifact-bo4e-converter.
4+
5+
It allows you to convert EDIFACT messages to BO4E and vice versa by speaking to Hochfreqeunz's transformer.bee service.
6+
Note that the actual conversion happens in the transformer.bee service/backend, this library only provides a convenient way to use its API.
7+
8+
## How to use this library
9+
10+
### Prerequisites / Account
11+
12+
First of all, you need an account to use transformer.bee.
13+
Ask info@hochfrequenz.de or ping @JoschaMetze on GitHub to get one.
14+
15+
You can check if your account is working by logging [into our stage environment](https://transformerstage.utilibee.io/app/).
16+
17+
### Using the client
18+
19+
Install the package from NuGet:
20+
21+
```bash
22+
nuget install Hochfrequenz.transformer.bee.Client
23+
```
24+
25+
### Use it in your code
26+
27+
Then, you can use the client like this:
28+
29+
```csharp
30+
31+
```

TransformerBeeClient/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
TransformerBeeClient/obj
2+
TransformerBeeClient/bin
3+
TransformerBeeClient.IntegrationTest/obj
4+
TransformerBeeClient.IntegrationTest/bin
5+
TransformerBeeClient.UnitTest/obj
6+
TransformerBeeClient.UnitTest/bin

TransformerBeeClient/.idea/.idea.TransformerBeeClient/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)