Skip to content

Commit e8aa31c

Browse files
authored
Merge pull request #111 from sir-gon/develop
Develop
2 parents e2e253e + fb10e7d commit e8aa31c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+54
-53
lines changed

.github/workflows/snyk-code.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ jobs:
2727
with:
2828
dotnet-version: 8.0.x
2929
- name: Restore dependencies
30-
run: dotnet restore algorithm-exercises-csharp.sln
30+
run: dotnet restore algorithm_exercises_csharp.sln
3131
- name: Run Snyk to check for vulnerabilities
3232
continue-on-error: true # To make sure that SARIF upload gets called
3333
run: >
3434
snyk test
35-
algorithm-exercises-csharp/
36-
algorithm-exercises-csharp-base/
37-
algorithm-exercises-csharp-test/
35+
algorithm_exercises_csharp/
36+
algorithm_exercises_csharp_base/
37+
algorithm_exercises_csharp_test/
3838
--sarif-file-output=snyk-code.sarif
3939
env:
4040
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

Dockerfile

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ ENV WORKDIR=/app
1313
WORKDIR ${WORKDIR}
1414

1515
COPY ./Makefile ${WORKDIR}/
16-
COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln
17-
COPY ./algorithm-exercises-csharp/algorithm-exercises-csharp.csproj ${WORKDIR}/algorithm-exercises-csharp/algorithm-exercises-csharp.csproj
18-
COPY ./algorithm-exercises-csharp-base/algorithm-exercises-csharp-base.csproj ${WORKDIR}/algorithm-exercises-csharp-base/algorithm-exercises-csharp-base.csproj
19-
COPY ./algorithm-exercises-csharp-test/algorithm-exercises-csharp-test.csproj ${WORKDIR}/algorithm-exercises-csharp-test/algorithm-exercises-csharp-test.csproj
16+
COPY ./algorithm_exercises_csharp.sln ${WORKDIR}/algorithm_exercises_csharp.sln
17+
COPY ./algorithm_exercises_csharp/algorithm_exercises_csharp.csproj ${WORKDIR}/algorithm_exercises_csharp/algorithm_exercises_csharp.csproj
18+
COPY ./algorithm_exercises_csharp_base/algorithm_exercises_csharp_base.csproj ${WORKDIR}/algorithm_exercises_csharp_base/algorithm_exercises_csharp_base.csproj
19+
COPY ./algorithm_exercises_csharp_test/algorithm_exercises_csharp_test.csproj ${WORKDIR}/algorithm_exercises_csharp_test/algorithm_exercises_csharp_test.csproj
2020

2121
RUN make dependencies
2222

@@ -26,10 +26,9 @@ FROM base AS lint
2626
ENV WORKDIR=/app
2727
WORKDIR ${WORKDIR}
2828

29-
RUN apk add --update --no-cache make nodejs npm
30-
RUN apk add --update --no-cache yamllint
31-
32-
RUN npm install -g --ignore-scripts markdownlint-cli
29+
RUN apk add --update --no-cache make nodejs npm \
30+
&& apk add --update --no-cache yamllint \
31+
&& npm install -g --ignore-scripts markdownlint-cli
3332

3433
# [!TIP] Use a bind-mount to "/app" to override following "copys"
3534
# for lint and test against "current" sources in this stage
@@ -45,10 +44,10 @@ COPY ./LICENSE.md ${WORKDIR}/
4544
COPY ./CODE_OF_CONDUCT.md ${WORKDIR}/
4645

4746
# Code source
48-
COPY ./algorithm-exercises-csharp ${WORKDIR}/algorithm-exercises-csharp
49-
COPY ./algorithm-exercises-csharp-base ${WORKDIR}/algorithm-exercises-csharp-base
50-
COPY ./algorithm-exercises-csharp-test ${WORKDIR}/algorithm-exercises-csharp-test
51-
COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln
47+
COPY ./algorithm_exercises_csharp.sln ${WORKDIR}/algorithm_exercises_csharp.sln
48+
COPY ./algorithm_exercises_csharp ${WORKDIR}/algorithm_exercises_csharp
49+
COPY ./algorithm_exercises_csharp_base ${WORKDIR}/algorithm_exercises_csharp_base
50+
COPY ./algorithm_exercises_csharp_test ${WORKDIR}/algorithm_exercises_csharp_test
5251

5352
# code linting conf
5453
COPY ./.editorconfig ${WORKDIR}/
@@ -65,20 +64,20 @@ CMD ["make", "lint"]
6564
###############################################################################
6665
FROM base AS development
6766

68-
COPY ./algorithm-exercises-csharp ${WORKDIR}/algorithm-exercises-csharp
69-
COPY ./algorithm-exercises-csharp-base ${WORKDIR}/algorithm-exercises-csharp-base
70-
COPY ./algorithm-exercises-csharp-test ${WORKDIR}/algorithm-exercises-csharp-test
71-
COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln
67+
COPY ./algorithm_exercises_csharp.sln ${WORKDIR}/algorithm_exercises_csharp.sln
68+
COPY ./algorithm_exercises_csharp ${WORKDIR}/algorithm_exercises_csharp
69+
COPY ./algorithm_exercises_csharp_base ${WORKDIR}/algorithm_exercises_csharp_base
70+
COPY ./algorithm_exercises_csharp_test ${WORKDIR}/algorithm_exercises_csharp_test
7271

73-
RUN make build
74-
RUN ls -alh
72+
RUN make build \
73+
&& ls -alh
7574

7675
# CMD []
7776
###############################################################################
7877
FROM development AS builder
7978

80-
RUN dotnet publish --self-contained --runtime linux-musl-x64
81-
RUN ls -alh
79+
RUN dotnet publish --self-contained --runtime linux-musl-x64 \
80+
&& ls -alh
8281

8382
CMD ["ls", "-alh"]
8483

@@ -106,19 +105,20 @@ CMD ["make", "test"]
106105
##
107106
FROM mcr.microsoft.com/dotnet/runtime:8.0.8-alpine3.19-amd64 AS production
108107

108+
RUN apk add --update --no-cache make
109+
109110
ENV LOG_LEVEL=info
110111
ENV BRUTEFORCE=false
111112
ENV WORKDIR=/app
112113
WORKDIR ${WORKDIR}
113114

114-
RUN adduser -D worker
115-
RUN mkdir -p /app
116-
RUN chown worker:worker /app
115+
RUN adduser -D worker \
116+
&& mkdir -p /app \
117+
&& chown worker:worker /app
117118

118-
RUN apk add --update --no-cache make
119119
COPY ./Makefile ${WORKDIR}/
120-
COPY --from=builder /app/algorithm-exercises-csharp/bin/Release/net8.0/algorithm-exercises-csharp.dll ${WORKDIR}/
121-
COPY --from=builder /app/algorithm-exercises-csharp/bin/Release/net8.0/algorithm-exercises-csharp.runtimeconfig.json ${WORKDIR}/
120+
COPY --from=builder /app/algorithm_exercises_csharp/bin/Release/net8.0/algorithm_exercises_csharp.dll ${WORKDIR}/
121+
COPY --from=builder /app/algorithm_exercises_csharp/bin/Release/net8.0/algorithm_exercises_csharp.runtimeconfig.json ${WORKDIR}/
122122

123123
RUN ls -alh
124124

Makefile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ RUNTIME_TOOL=dotnet
3333
PACKAGE_TOOL=dotnet
3434
VERBOSITY_LEVEL=normal
3535

36-
PROJECT_DIRECTORY=algorithm-exercises-csharp
37-
BASE_PROJECT_DIRECTORY=algorithm-exercises-csharp-base
38-
TEST_PROJECT_DIRECTORY=algorithm-exercises-csharp-test
36+
MAIN_PROJECT_DIRECTORY=algorithm_exercises_csharp
37+
BASE_PROJECT_DIRECTORY=algorithm_exercises_csharp_base
38+
TEST_PROJECT_DIRECTORY=algorithm_exercises_csharp_test
3939

4040
help: list
4141
@echo ""
@@ -114,9 +114,9 @@ clean:
114114

115115
rm -vfr .mono/ || true
116116
rm -vfr coverage-report/ || true
117-
find ${PROJECT_DIRECTORY} -path "*/TestResults/*" -type d -print -exec rm -vfr {} ';' || true
118-
find ${PROJECT_DIRECTORY} -path "*/bin/*" -print -exec rm -vfr {} ';' || true
119-
find ${PROJECT_DIRECTORY} -path "*/obj/*" -print -exec rm -vfr {} ';' || true
117+
find ${MAIN_PROJECT_DIRECTORY} -path "*/TestResults/*" -type d -print -exec rm -vfr {} ';' || true
118+
find ${MAIN_PROJECT_DIRECTORY} -path "*/bin/*" -print -exec rm -vfr {} ';' || true
119+
find ${MAIN_PROJECT_DIRECTORY} -path "*/obj/*" -print -exec rm -vfr {} ';' || true
120120

121121
find ${BASE_PROJECT_DIRECTORY} -path "*/TestResults/*" -type d -print -exec rm -vfr {} ';' || true
122122
find ${BASE_PROJECT_DIRECTORY} -path "*/bin/*" -print -exec rm -vfr {} ';' || true
@@ -128,34 +128,34 @@ clean:
128128
find ${TEST_PROJECT_DIRECTORY} -path "*/obj/*" -print -exec rm -vfr {} ';' || true
129129

130130
compose/build: env
131-
docker-compose --profile lint build
132-
docker-compose --profile testing build
133-
docker-compose --profile production build
131+
${DOCKER_COMPOSE} --profile lint build
132+
${DOCKER_COMPOSE} --profile testing build
133+
${DOCKER_COMPOSE} --profile production build
134134

135135
compose/rebuild: env
136-
docker-compose --profile lint build --no-cache
137-
docker-compose --profile testing build --no-cache
138-
docker-compose --profile production build --no-cache
136+
${DOCKER_COMPOSE} --profile lint build --no-cache
137+
${DOCKER_COMPOSE} --profile testing build --no-cache
138+
${DOCKER_COMPOSE} --profile production build --no-cache
139139

140140
compose/lint/markdown: compose/build
141-
docker-compose --profile lint run --rm algorithm-exercises-csharp-lint make lint/markdown
141+
${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-csharp-lint make lint/markdown
142142

143143
compose/lint/yaml: compose/build
144-
docker-compose --profile lint run --rm algorithm-exercises-csharp-lint make lint/yaml
144+
${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-csharp-lint make lint/yaml
145145

146146
compose/test/styling: compose/build
147-
docker-compose --profile lint run --rm algorithm-exercises-csharp-lint make test/styling
147+
${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-csharp-lint make test/styling
148148

149149
compose/test/static: compose/build
150-
docker-compose --profile lint run --rm algorithm-exercises-csharp-lint make test/static
150+
${DOCKER_COMPOSE} --profile lint run --rm algorithm-exercises-csharp-lint make test/static
151151

152152
compose/lint: compose/lint/markdown compose/lint/yaml compose/test/styling compose/test/static
153153

154154
compose/test: compose/build
155-
docker-compose --profile testing run --rm algorithm-exercises-csharp-test make test
155+
${DOCKER_COMPOSE} --profile testing run --rm algorithm-exercises-csharp-test make test
156156

157157
compose/run: compose/build
158-
docker-compose --profile production run --rm algorithm-exercises-csharp make run
158+
${DOCKER_COMPOSE} --profile production run --rm algorithm-exercises-csharp make run
159159

160160
all: lint coverage
161161

algorithm-exercises-csharp.sln renamed to algorithm_exercises_csharp.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm-exercises-csharp-test", "algorithm-exercises-csharp-test\algorithm-exercises-csharp-test.csproj", "{817BA968-9A1F-4DDB-8A96-657DCA862227}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm_exercises_csharp_test", "algorithm_exercises_csharp_test\algorithm_exercises_csharp_test.csproj", "{817BA968-9A1F-4DDB-8A96-657DCA862227}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm-exercises-csharp", "algorithm-exercises-csharp\algorithm-exercises-csharp.csproj", "{B162EE62-90C6-4871-B278-390804615987}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm_exercises_csharp", "algorithm_exercises_csharp\algorithm_exercises_csharp.csproj", "{B162EE62-90C6-4871-B278-390804615987}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm-exercises-csharp-base", "algorithm-exercises-csharp-base\algorithm-exercises-csharp-base.csproj", "{1BC65C42-83A6-486D-84DB-0DC63002FA24}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm_exercises_csharp_base", "algorithm_exercises_csharp_base\algorithm_exercises_csharp_base.csproj", "{1BC65C42-83A6-486D-84DB-0DC63002FA24}"
1111
EndProject
1212
Global
1313
GlobalSection(SolutionConfigurationPlatforms) = preSolution

algorithm-exercises-csharp/algorithm-exercises-csharp.csproj renamed to algorithm_exercises_csharp/algorithm_exercises_csharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup>
19-
<ProjectReference Include="../algorithm-exercises-csharp-base/algorithm-exercises-csharp-base.csproj" />
19+
<ProjectReference Include="../algorithm_exercises_csharp_base/algorithm_exercises_csharp_base.csproj" />
2020
</ItemGroup>
2121
</Project>

algorithm-exercises-csharp-test/algorithm-exercises-csharp-test.csproj renamed to algorithm_exercises_csharp_test/algorithm_exercises_csharp_test.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
3333
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
3434
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
35+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
3536
<PackageReference Include="ReportGenerator" Version="5.3.8" />
3637
</ItemGroup>
3738

@@ -45,7 +46,7 @@
4546
</ItemGroup>
4647

4748
<ItemGroup>
48-
<ProjectReference Include="../algorithm-exercises-csharp/algorithm-exercises-csharp.csproj" />
49+
<ProjectReference Include="../algorithm_exercises_csharp/algorithm_exercises_csharp.csproj" />
4950
</ItemGroup>
5051

5152
<Target Name="GenerateHtmlCoverageReport" AfterTargets="GenerateCoverageResultAfterTest">

0 commit comments

Comments
 (0)