|
1 | | -######################################################################################################################## |
2 | | -# shellcheck - lining for bash scrips |
3 | | -FROM koalaman/shellcheck-alpine:stable |
| 1 | +################################################################################ |
| 2 | +# shellcheck |
| 3 | +FROM koalaman/shellcheck-alpine:stable AS shellcheck |
4 | 4 |
|
| 5 | +WORKDIR /source |
5 | 6 | COPY . . |
6 | 7 |
|
7 | 8 | # Run shell check on all the shell files. |
8 | | -RUN find . -type f -name '*.sh' | wc -l find . -type f -name '*.sh' | xargs shellcheck --external-sources --color=always |
9 | | - |
10 | | -######################################################################################################################## |
11 | | -# .NET Core 3.1 |
12 | | -FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine |
13 | | - |
14 | | -WORKDIR /work |
15 | | - |
16 | | -# Copy just the solution and proj files to make best use of docker image caching. |
17 | | -COPY ./castle.core.asyncinterceptor.sln . |
18 | | -COPY ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj |
19 | | -COPY ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj |
20 | | - |
21 | | -# Run restore on just the project files, this should cache the image after restore. |
22 | | -RUN dotnet restore |
23 | | - |
24 | | -COPY . . |
25 | | - |
26 | | -RUN ./coverage.sh netcoreapp3.1 Debug |
27 | | - |
28 | | -######################################################################################################################## |
29 | | -# .NET 5 |
30 | | -FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine |
31 | | - |
32 | | -WORKDIR /work |
33 | | - |
34 | | -# Copy just the solution and proj files to make best use of docker image caching. |
35 | | -COPY ./castle.core.asyncinterceptor.sln . |
36 | | -COPY ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj |
37 | | -COPY ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj |
38 | | - |
39 | | -# Run restore on just the project files, this should cache the image after restore. |
40 | | -RUN dotnet restore |
41 | | - |
42 | | -COPY . . |
43 | | - |
44 | | -RUN ./coverage.sh net5.0 Debug |
| 9 | +RUN find . -type f -name '*.sh' | wc -l \ |
| 10 | +&& find . -type f -name '*.sh' | xargs shellcheck --external-sources --color=always |
45 | 11 |
|
46 | 12 | ######################################################################################################################## |
47 | 13 | # .NET 6 |
48 | | -FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine |
| 14 | +FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS test |
| 15 | + |
| 16 | +ENV CI=true |
49 | 17 |
|
50 | | -WORKDIR /work |
| 18 | +WORKDIR /source |
51 | 19 |
|
52 | 20 | # Copy just the solution and proj files to make best use of docker image caching. |
53 | | -COPY ./castle.core.asyncinterceptor.sln . |
54 | | -COPY ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj |
55 | | -COPY ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj |
| 21 | +COPY *.props *.sln ./ |
| 22 | +COPY ./src/Castle.Core.AsyncInterceptor/*.csproj ./src/Castle.Core.AsyncInterceptor/ |
| 23 | +COPY ./test/Castle.Core.AsyncInterceptor.Tests/*.csproj ./test/Castle.Core.AsyncInterceptor.Tests/ |
56 | 24 |
|
57 | 25 | # Run restore on just the project files, this should cache the image after restore. |
58 | 26 | RUN dotnet restore |
|
0 commit comments