Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sungaila committed Jul 3, 2024
1 parent 42a3210 commit 3dfb1c3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ jobs:
run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled . && docker run --rm -t console
- name: console (windows)
if: runner.os == 'Windows' && (success() || failure())
run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/windows . && docker run --rm -t console
run: copy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows" windows && docker build -t console -f windows . && docker run --rm -t console
- name: console (windows-aot)
if: runner.os == 'Windows' && (success() || failure())
run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/windows-aot . && docker run --rm -t console
run: copy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-aot" windows-aot && docker build -t console -f windows . && docker run --rm -t console
- name: docker system prune
if: success() || failure()
run: docker system prune -a -f
Expand All @@ -270,7 +270,7 @@ jobs:
run: docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f src/Tests/Dockerfiles/linux . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests
- name: unittests (windows)
if: runner.os == 'Windows' && (success() || failure())
run: docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f src/Tests/Dockerfiles/windows . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests
run: copy /y "src\Tests\Dockerfiles\windows" windows && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests
- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@main
Expand Down
2 changes: 1 addition & 1 deletion src/FrameworkTests/AotConsole/Dockerfiles/windows
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"]
RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0
COPY . .
WORKDIR "/src/src"
RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore
RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore

FROM base AS final
WORKDIR /app
Expand Down
6 changes: 3 additions & 3 deletions src/FrameworkTests/AotConsole/Dockerfiles/windows-aot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-nanoserver-ltsc2022 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build
Expand All @@ -9,11 +9,11 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"]
RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0
COPY . .
WORKDIR "/src/src"
RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore
RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore
RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore

FROM base AS final
WORKDIR /app
Expand Down
6 changes: 3 additions & 3 deletions src/Tests/Dockerfiles/windows
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ ARG TARGET_FRAMEWORK=net8.0
WORKDIR /src
COPY ["src/Tests/Tests.csproj", "src/Tests/Tests.csproj"]
COPY ["src/PDFtoImage", "src/PDFtoImage"]
RUN dotnet restore "./src/Tests/Tests.csproj" /p:TargetFramework=$TARGET_FRAMEWORK
RUN dotnet restore "./src/Tests/Tests.csproj" /p:TargetFramework=%TARGET_FRAMEWORK%
COPY . .
WORKDIR "/src/src"
RUN dotnet build "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/build/$TARGET_FRAMEWORK --no-restore -f $TARGET_FRAMEWORK
RUN dotnet build "./Tests/Tests.csproj" -c %BUILD_CONFIGURATION% -o /app/build/%TARGET_FRAMEWORK% --no-restore -f %TARGET_FRAMEWORK%

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore -f $TARGET_FRAMEWORK
RUN dotnet publish "./Tests/Tests.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore -f %TARGET_FRAMEWORK%

FROM base AS final
WORKDIR /app
Expand Down

0 comments on commit 3dfb1c3

Please sign in to comment.