From fbe8653259ce498a0275c6d53d2dfd9018bdebb3 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Tue, 2 Jul 2024 19:56:28 +0200 Subject: [PATCH 01/42] Run tests in docker --- .dockerignore | 30 ++++++++++++++++++++++++++++++ .github/workflows/dotnet.yml | 32 ++++++++++++++++++++++++++++++++ src/Tests/Dockerfiles/Dockerfile | 5 +++++ 3 files changed, 67 insertions(+) create mode 100644 .dockerignore create mode 100644 src/Tests/Dockerfiles/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..fe1152bd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f3a62d0f..1e22f300 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -24,6 +24,11 @@ on: description: Run tests required: true default: true + run_docker: + type: boolean + description: Run docker tests + required: true + default: true generate_assets: type: boolean description: Generate assets from test runs @@ -226,6 +231,33 @@ jobs: path: ./**/Assets/Generated if-no-files-found: error retention-days: 1 + docker: + name: Docker (${{ matrix.os }}) + needs: build + strategy: + fail-fast: false + matrix: + os: [windows-latest] + runs-on: ${{ matrix.os }} + if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_docker) == true + steps: + - name: Download test assemblies + if: success() || failure() + uses: actions/download-artifact@main + with: + name: Test assemblies + - name: docker build + run: docker build -t test-client -f src/Tests/Dockerfiles/Dockerfile . + - name: docker run + run: docker run --rm --mount type=bind,source=${GITHUB_WORKSPACE}/TestResults,target=/app/TestResults -t test-client + - name: Upload test results + if: success() || failure() + uses: actions/upload-artifact@main + with: + name: Docker test results (${{ matrix.os }}) + path: ./**/*.trx + if-no-files-found: error + retention-days: 1 publish-test-results: name: Publish tests results needs: test diff --git a/src/Tests/Dockerfiles/Dockerfile b/src/Tests/Dockerfiles/Dockerfile new file mode 100644 index 00000000..25ca69f5 --- /dev/null +++ b/src/Tests/Dockerfiles/Dockerfile @@ -0,0 +1,5 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 +USER app +WORKDIR /app +COPY . . +ENTRYPOINT ["dotnet", "test", "net8.0/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file From 2cbd2b2ab3185faf4dcec23c42c653f7b4db2164 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Tue, 2 Jul 2024 20:30:24 +0200 Subject: [PATCH 02/42] Update workflow --- .github/workflows/dotnet.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 1e22f300..2d3e3fee 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -232,15 +232,21 @@ jobs: if-no-files-found: error retention-days: 1 docker: - name: Docker (${{ matrix.os }}) + name: Test (docker ${{ matrix.os }}) needs: build strategy: fail-fast: false matrix: - os: [windows-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_docker) == true steps: + - name: Checkout + uses: actions/checkout@main + with: + fetch-depth: 0 + sparse-checkout: | + src/Tests/Dockerfiles - name: Download test assemblies if: success() || failure() uses: actions/download-artifact@main @@ -249,12 +255,12 @@ jobs: - name: docker build run: docker build -t test-client -f src/Tests/Dockerfiles/Dockerfile . - name: docker run - run: docker run --rm --mount type=bind,source=${GITHUB_WORKSPACE}/TestResults,target=/app/TestResults -t test-client + run: docker run --rm --mount type=bind,source=.,target=/app/TestResults -t test-client - name: Upload test results if: success() || failure() uses: actions/upload-artifact@main with: - name: Docker test results (${{ matrix.os }}) + name: Test results (docker ${{ matrix.os }}) path: ./**/*.trx if-no-files-found: error retention-days: 1 From b2bd88b907628bcb89e2c00edaefe42ce2419e66 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Tue, 2 Jul 2024 21:08:09 +0200 Subject: [PATCH 03/42] Update workflows --- .github/workflows/dotnet.yml | 23 +++++++++++++++++-- .../AotConsole/Dockerfiles/Dockerfile | 5 ++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2d3e3fee..32357b00 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -153,6 +153,14 @@ jobs: path: src/FrameworkTests/MonoConsole/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }} if-no-files-found: error retention-days: 1 + - name: Publish test project AotConsole + uses: actions/upload-artifact@main + if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_tests) == true + with: + name: AotConsole + path: src/FrameworkTests/AotConsole/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }} + if-no-files-found: error + retention-days: 1 test: name: Test (${{ matrix.os }}) needs: build @@ -232,7 +240,7 @@ jobs: if-no-files-found: error retention-days: 1 docker: - name: Test (docker ${{ matrix.os }}) + name: Test (${{ matrix.os }}; docker) needs: build strategy: fail-fast: false @@ -246,6 +254,7 @@ jobs: with: fetch-depth: 0 sparse-checkout: | + src/FrameworkTests/AotConsole/Dockerfiles src/Tests/Dockerfiles - name: Download test assemblies if: success() || failure() @@ -255,7 +264,7 @@ jobs: - name: docker build run: docker build -t test-client -f src/Tests/Dockerfiles/Dockerfile . - name: docker run - run: docker run --rm --mount type=bind,source=.,target=/app/TestResults -t test-client + run: docker run --rm --mount type=bind,source=${{ github.workspace }}/TestResults,target=/app/TestResults -t test-client - name: Upload test results if: success() || failure() uses: actions/upload-artifact@main @@ -264,6 +273,16 @@ jobs: path: ./**/*.trx if-no-files-found: error retention-days: 1 + - name: Download test project AotConsole + if: success() || failure() + uses: actions/download-artifact@main + with: + name: AotConsole + path: AotConsole + - name: docker build + run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile . + - name: docker run + run: docker run --rm -t aotconsole publish-test-results: name: Publish tests results needs: test diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile new file mode 100644 index 00000000..81d8f072 --- /dev/null +++ b/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile @@ -0,0 +1,5 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0 +USER app +WORKDIR /app +COPY ["AotConsole", "."] +ENTRYPOINT ["dotnet", "net8.0/PDFtoImage.FrameworkTests.AotConsole.dll"] \ No newline at end of file From 9494b0b2fa17fd9c34e2436c95078504a325722b Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Tue, 2 Jul 2024 21:37:13 +0200 Subject: [PATCH 04/42] Update workflows --- .github/workflows/dotnet.yml | 24 ++++++++++--------- .../AotConsole/Dockerfiles/Dockerfile | 2 +- src/Tests/Dockerfiles/Dockerfile | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 32357b00..f6857d15 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -256,15 +256,27 @@ jobs: sparse-checkout: | src/FrameworkTests/AotConsole/Dockerfiles src/Tests/Dockerfiles + - name: Download test project AotConsole + uses: actions/download-artifact@main + with: + name: AotConsole + path: AotConsole + - name: docker build + run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile . + - name: docker run + run: docker run --rm -t aotconsole net8.0/PDFtoImage.FrameworkTests.AotConsole.dll - name: Download test assemblies if: success() || failure() uses: actions/download-artifact@main with: name: Test assemblies - name: docker build + id: build-test + if: success() || failure() run: docker build -t test-client -f src/Tests/Dockerfiles/Dockerfile . - name: docker run - run: docker run --rm --mount type=bind,source=${{ github.workspace }}/TestResults,target=/app/TestResults -t test-client + if: steps.build-test.outcome == 'success' + run: docker run --rm --mount type=bind,source=${{ github.workspace }}/TestResults,target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll - name: Upload test results if: success() || failure() uses: actions/upload-artifact@main @@ -273,16 +285,6 @@ jobs: path: ./**/*.trx if-no-files-found: error retention-days: 1 - - name: Download test project AotConsole - if: success() || failure() - uses: actions/download-artifact@main - with: - name: AotConsole - path: AotConsole - - name: docker build - run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile . - - name: docker run - run: docker run --rm -t aotconsole publish-test-results: name: Publish tests results needs: test diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile index 81d8f072..29d60884 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile @@ -2,4 +2,4 @@ USER app WORKDIR /app COPY ["AotConsole", "."] -ENTRYPOINT ["dotnet", "net8.0/PDFtoImage.FrameworkTests.AotConsole.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "run"] \ No newline at end of file diff --git a/src/Tests/Dockerfiles/Dockerfile b/src/Tests/Dockerfiles/Dockerfile index 25ca69f5..d57afbdb 100644 --- a/src/Tests/Dockerfiles/Dockerfile +++ b/src/Tests/Dockerfiles/Dockerfile @@ -2,4 +2,4 @@ USER app WORKDIR /app COPY . . -ENTRYPOINT ["dotnet", "test", "net8.0/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file +ENTRYPOINT ["dotnet", "test", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file From 91a8f1a40e17cdb062123aa3cf523fd5e6e1cde1 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Tue, 2 Jul 2024 22:00:54 +0200 Subject: [PATCH 05/42] Update dockerfiles --- src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile index 29d60884..78d2470a 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile @@ -2,4 +2,4 @@ USER app WORKDIR /app COPY ["AotConsole", "."] -ENTRYPOINT ["dotnet", "run"] \ No newline at end of file +ENTRYPOINT ["dotnet"] \ No newline at end of file From 499b0da0106b31f38a87b299553188a0875c338e Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Tue, 2 Jul 2024 23:14:50 +0200 Subject: [PATCH 06/42] Update dotnet.yml --- .github/workflows/dotnet.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f6857d15..dcce9aeb 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -262,9 +262,11 @@ jobs: name: AotConsole path: AotConsole - name: docker build + shell: pwsh run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile . - name: docker run - run: docker run --rm -t aotconsole net8.0/PDFtoImage.FrameworkTests.AotConsole.dll + shell: pwsh + run: docker run -t aotconsole net8.0/PDFtoImage.FrameworkTests.AotConsole.dll - name: Download test assemblies if: success() || failure() uses: actions/download-artifact@main @@ -272,10 +274,12 @@ jobs: name: Test assemblies - name: docker build id: build-test + shell: pwsh if: success() || failure() run: docker build -t test-client -f src/Tests/Dockerfiles/Dockerfile . - name: docker run - if: steps.build-test.outcome == 'success' + shell: pwsh + if: steps.build-test.conclusion == 'success' run: docker run --rm --mount type=bind,source=${{ github.workspace }}/TestResults,target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll - name: Upload test results if: success() || failure() From 8b00fab1a36ab437780e01c33c265d68792ba595 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Tue, 2 Jul 2024 23:41:07 +0200 Subject: [PATCH 07/42] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index dcce9aeb..540a7cf6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -280,7 +280,7 @@ jobs: - name: docker run shell: pwsh if: steps.build-test.conclusion == 'success' - run: docker run --rm --mount type=bind,source=${{ github.workspace }}/TestResults,target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll + run: docker run --rm --mount type=bind,source=${{ github.workspace }},target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll - name: Upload test results if: success() || failure() uses: actions/upload-artifact@main From 36e68d07a641c98d88e1b1e3cb2d9581404d27c8 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 00:22:32 +0200 Subject: [PATCH 08/42] Update workflows --- .github/workflows/dotnet.yml | 8 ++++---- src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile | 1 - src/Tests/Dockerfiles/Dockerfile | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 540a7cf6..0107f407 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -261,10 +261,10 @@ jobs: with: name: AotConsole path: AotConsole - - name: docker build + - name: docker build aotconsole shell: pwsh run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile . - - name: docker run + - name: docker run aotconsole shell: pwsh run: docker run -t aotconsole net8.0/PDFtoImage.FrameworkTests.AotConsole.dll - name: Download test assemblies @@ -272,12 +272,12 @@ jobs: uses: actions/download-artifact@main with: name: Test assemblies - - name: docker build + - name: docker build test-client id: build-test shell: pwsh if: success() || failure() run: docker build -t test-client -f src/Tests/Dockerfiles/Dockerfile . - - name: docker run + - name: docker run test-client shell: pwsh if: steps.build-test.conclusion == 'success' run: docker run --rm --mount type=bind,source=${{ github.workspace }},target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile index 78d2470a..c17a02e4 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile @@ -1,5 +1,4 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0 -USER app WORKDIR /app COPY ["AotConsole", "."] ENTRYPOINT ["dotnet"] \ No newline at end of file diff --git a/src/Tests/Dockerfiles/Dockerfile b/src/Tests/Dockerfiles/Dockerfile index d57afbdb..fd3d43ee 100644 --- a/src/Tests/Dockerfiles/Dockerfile +++ b/src/Tests/Dockerfiles/Dockerfile @@ -1,5 +1,4 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 -USER app WORKDIR /app COPY . . ENTRYPOINT ["dotnet", "test", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file From 8fe3ec8d55e23ba872e67cd6d447e00bfe1d7b87 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 02:39:44 +0200 Subject: [PATCH 09/42] Update dockerfiles --- .github/workflows/dotnet.yml | 59 +++++++++---------- .../AotConsole/AotConsole.csproj | 1 + .../AotConsole/Dockerfiles/Dockerfile | 4 -- .../AotConsole/Dockerfiles/linux | 18 ++++++ .../AotConsole/Dockerfiles/linux-aot | 25 ++++++++ .../AotConsole/Dockerfiles/linux-aot-chiseled | 25 ++++++++ .../AotConsole/Dockerfiles/linux-chiseled | 18 ++++++ .../AotConsole/Dockerfiles/windows | 18 ++++++ .../AotConsole/Dockerfiles/windows-aot | 22 +++++++ src/Tests/Dockerfiles/{Dockerfile => linux} | 0 src/Tests/Dockerfiles/windows | 4 ++ 11 files changed, 159 insertions(+), 35 deletions(-) delete mode 100644 src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile create mode 100644 src/FrameworkTests/AotConsole/Dockerfiles/linux create mode 100644 src/FrameworkTests/AotConsole/Dockerfiles/linux-aot create mode 100644 src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled create mode 100644 src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled create mode 100644 src/FrameworkTests/AotConsole/Dockerfiles/windows create mode 100644 src/FrameworkTests/AotConsole/Dockerfiles/windows-aot rename src/Tests/Dockerfiles/{Dockerfile => linux} (100%) create mode 100644 src/Tests/Dockerfiles/windows diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0107f407..b44dbd14 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -153,14 +153,6 @@ jobs: path: src/FrameworkTests/MonoConsole/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }} if-no-files-found: error retention-days: 1 - - name: Publish test project AotConsole - uses: actions/upload-artifact@main - if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_tests) == true - with: - name: AotConsole - path: src/FrameworkTests/AotConsole/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }} - if-no-files-found: error - retention-days: 1 test: name: Test (${{ matrix.os }}) needs: build @@ -240,12 +232,12 @@ jobs: if-no-files-found: error retention-days: 1 docker: - name: Test (${{ matrix.os }}; docker) + name: Docker (${{ matrix.os }}) needs: build strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} if: success() && (github.event_name != 'workflow_dispatch' && true || inputs.run_docker) == true steps: @@ -254,33 +246,38 @@ jobs: with: fetch-depth: 0 sparse-checkout: | - src/FrameworkTests/AotConsole/Dockerfiles + src/PDFtoImage + src/FrameworkTests/AotConsole src/Tests/Dockerfiles - - name: Download test project AotConsole - uses: actions/download-artifact@main - with: - name: AotConsole - path: AotConsole - - name: docker build aotconsole - shell: pwsh - run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile . - - name: docker run aotconsole - shell: pwsh - run: docker run -t aotconsole net8.0/PDFtoImage.FrameworkTests.AotConsole.dll + - name: aotconsole linux + if: runner.os == 'Linux' && (success() || failure()) + run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/linux . && docker run --rm -t aotconsole + - name: aotconsole linux-chiseled + if: runner.os == 'Linux' && (success() || failure()) + run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled . && docker run --rm -t aotconsole + - name: aotconsole linux-aot + if: runner.os == 'Linux' && (success() || failure()) + run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot . && docker run --rm -t aotconsole + - name: aotconsole linux-aot-chiseled + if: runner.os == 'Linux' && (success() || failure()) + run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled . && docker run --rm -t aotconsole + - name: aotconsole windows + if: runner.os == 'Windows' && (success() || failure()) + run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/windows . && docker run --rm -t aotconsole + - name: aotconsole windows-aot + if: runner.os == 'Windows' && (success() || failure()) + run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/windows-aot . && docker run --rm -t aotconsole - name: Download test assemblies if: success() || failure() uses: actions/download-artifact@main with: name: Test assemblies - - name: docker build test-client - id: build-test - shell: pwsh - if: success() || failure() - run: docker build -t test-client -f src/Tests/Dockerfiles/Dockerfile . - - name: docker run test-client - shell: pwsh - if: steps.build-test.conclusion == 'success' - run: docker run --rm --mount type=bind,source=${{ github.workspace }},target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll + - name: test-client linux + if: runner.os == 'Linux' && (success() || failure()) + run: docker build -t test-client -f src/Tests/Dockerfiles/linux . && docker run --rm --mount type=bind,source=${{ github.workspace }},target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll + - name: test-client windows + if: runner.os == 'Windows' && (success() || failure()) + run: docker build -t test-client -f src/Tests/Dockerfiles/windows . && docker run --rm --mount type=bind,source=${{ github.workspace }},target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll - name: Upload test results if: success() || failure() uses: actions/upload-artifact@main diff --git a/src/FrameworkTests/AotConsole/AotConsole.csproj b/src/FrameworkTests/AotConsole/AotConsole.csproj index d421abaf..bcc8c6e8 100644 --- a/src/FrameworkTests/AotConsole/AotConsole.csproj +++ b/src/FrameworkTests/AotConsole/AotConsole.csproj @@ -2,6 +2,7 @@ Exe net8.0 + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 enable enable PDFtoImage.FrameworkTests.AotConsole diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile deleted file mode 100644 index c17a02e4..00000000 --- a/src/FrameworkTests/AotConsole/Dockerfiles/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM mcr.microsoft.com/dotnet/runtime:8.0 -WORKDIR /app -COPY ["AotConsole", "."] -ENTRYPOINT ["dotnet"] \ No newline at end of file diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux b/src/FrameworkTests/AotConsole/Dockerfiles/linux new file mode 100644 index 00000000..8c3c8c63 --- /dev/null +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +ARG TARGET_FRAMEWORK=net8.0 +WORKDIR /src +COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] +COPY ["src/PDFtoImage", "src/PDFtoImage"] +RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +COPY . . +WORKDIR "/src/src" +RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore + +FROM base AS final +WORKDIR /app +COPY --from=build /app/build . +ENTRYPOINT ["dotnet", "PDFtoImage.FrameworkTests.AotConsole.dll"] \ No newline at end of file diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot new file mode 100644 index 00000000..83988adf --- /dev/null +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot @@ -0,0 +1,25 @@ +FROM mcr.microsoft.com/dotnet/runtime-deps:8.0 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +ARG TARGET_FRAMEWORK=net8.0 +WORKDIR /src +COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] +COPY ["src/PDFtoImage", "src/PDFtoImage"] +RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +COPY . . +WORKDIR "/src/src" +RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN apt update && apt install -y \ + clang \ + zlib1g-dev +RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["./PDFtoImage.FrameworkTests.AotConsole"] \ No newline at end of file diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled new file mode 100644 index 00000000..86b0e56d --- /dev/null +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled @@ -0,0 +1,25 @@ +FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-noble-chiseled AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +ARG TARGET_FRAMEWORK=net8.0 +WORKDIR /src +COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] +COPY ["src/PDFtoImage", "src/PDFtoImage"] +RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +COPY . . +WORKDIR "/src/src" +RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN apt update && apt install -y \ + clang \ + zlib1g-dev +RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["./PDFtoImage.FrameworkTests.AotConsole"] \ No newline at end of file diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled b/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled new file mode 100644 index 00000000..d28a031c --- /dev/null +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0-noble-chiseled AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +ARG TARGET_FRAMEWORK=net8.0 +WORKDIR /src +COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] +COPY ["src/PDFtoImage", "src/PDFtoImage"] +RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +COPY . . +WORKDIR "/src/src" +RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore + +FROM base AS final +WORKDIR /app +COPY --from=build /app/build . +ENTRYPOINT ["dotnet", "PDFtoImage.FrameworkTests.AotConsole.dll"] \ No newline at end of file diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows b/src/FrameworkTests/AotConsole/Dockerfiles/windows new file mode 100644 index 00000000..240fe5f9 --- /dev/null +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +ARG BUILD_CONFIGURATION=Release +ARG TARGET_FRAMEWORK=net8.0 +WORKDIR /src +COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] +COPY ["src/PDFtoImage", "src/PDFtoImage"] +RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +COPY . . +WORKDIR "/src/src" +RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore + +FROM base AS final +WORKDIR /app +COPY --from=build /app/build . +ENTRYPOINT ["dotnet", "PDFtoImage.FrameworkTests.AotConsole.dll"] \ No newline at end of file diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot b/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot new file mode 100644 index 00000000..f29350e3 --- /dev/null +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot @@ -0,0 +1,22 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +ARG BUILD_CONFIGURATION=Release +ARG TARGET_FRAMEWORK=net8.0 +WORKDIR /src +COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] +COPY ["src/PDFtoImage", "src/PDFtoImage"] +RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +COPY . . +WORKDIR "/src/src" +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 + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["PDFtoImage.FrameworkTests.AotConsole.exe"] \ No newline at end of file diff --git a/src/Tests/Dockerfiles/Dockerfile b/src/Tests/Dockerfiles/linux similarity index 100% rename from src/Tests/Dockerfiles/Dockerfile rename to src/Tests/Dockerfiles/linux diff --git a/src/Tests/Dockerfiles/windows b/src/Tests/Dockerfiles/windows new file mode 100644 index 00000000..5d5e8cc9 --- /dev/null +++ b/src/Tests/Dockerfiles/windows @@ -0,0 +1,4 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 +WORKDIR /app +COPY . . +ENTRYPOINT ["dotnet", "test", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file From 4ecb579faf758e2d25d66b36f739c50c720f15b1 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 10:18:03 +0200 Subject: [PATCH 10/42] Update dockerfiles --- .github/workflows/dotnet.yml | 14 ++-------- .../AotConsole/Dockerfiles/linux | 3 +-- .../AotConsole/Dockerfiles/linux-aot | 3 +-- .../AotConsole/Dockerfiles/linux-aot-chiseled | 3 +-- .../AotConsole/Dockerfiles/linux-chiseled | 3 +-- .../AotConsole/Dockerfiles/windows | 3 +-- .../AotConsole/Dockerfiles/windows-aot | 3 +-- src/Tests/Dockerfiles/linux | 26 +++++++++++++++++-- src/Tests/Dockerfiles/windows | 26 +++++++++++++++++-- 9 files changed, 56 insertions(+), 28 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b44dbd14..ad5c1ffd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -233,7 +233,6 @@ jobs: retention-days: 1 docker: name: Docker (${{ matrix.os }}) - needs: build strategy: fail-fast: false matrix: @@ -245,10 +244,6 @@ jobs: uses: actions/checkout@main with: fetch-depth: 0 - sparse-checkout: | - src/PDFtoImage - src/FrameworkTests/AotConsole - src/Tests/Dockerfiles - name: aotconsole linux if: runner.os == 'Linux' && (success() || failure()) run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/linux . && docker run --rm -t aotconsole @@ -267,17 +262,12 @@ jobs: - name: aotconsole windows-aot if: runner.os == 'Windows' && (success() || failure()) run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/windows-aot . && docker run --rm -t aotconsole - - name: Download test assemblies - if: success() || failure() - uses: actions/download-artifact@main - with: - name: Test assemblies - name: test-client linux if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t test-client -f src/Tests/Dockerfiles/linux . && docker run --rm --mount type=bind,source=${{ github.workspace }},target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll + run: docker build -t test-client --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 test-client net8.0/PDFtoImage.Tests.dll - name: test-client windows if: runner.os == 'Windows' && (success() || failure()) - run: docker build -t test-client -f src/Tests/Dockerfiles/windows . && docker run --rm --mount type=bind,source=${{ github.workspace }},target=/app/TestResults -t test-client net8.0/PDFtoImage.Tests.dll + run: docker build -t test-client --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 test-client net8.0/PDFtoImage.Tests.dll - name: Upload test results if: success() || failure() uses: actions/upload-artifact@main diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux b/src/FrameworkTests/AotConsole/Dockerfiles/linux index 8c3c8c63..e02d3f15 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/linux +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux @@ -3,11 +3,10 @@ WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release -ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] COPY ["src/PDFtoImage", "src/PDFtoImage"] -RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +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 diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot index 83988adf..7d4d6ac1 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot @@ -3,11 +3,10 @@ WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release -ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] COPY ["src/PDFtoImage", "src/PDFtoImage"] -RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +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 diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled index 86b0e56d..4fec429e 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled @@ -3,11 +3,10 @@ WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release -ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] COPY ["src/PDFtoImage", "src/PDFtoImage"] -RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +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 diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled b/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled index d28a031c..adb3c40c 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled @@ -3,11 +3,10 @@ WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release -ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] COPY ["src/PDFtoImage", "src/PDFtoImage"] -RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +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 diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows b/src/FrameworkTests/AotConsole/Dockerfiles/windows index 240fe5f9..73aae040 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows @@ -3,11 +3,10 @@ WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build ARG BUILD_CONFIGURATION=Release -ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] COPY ["src/PDFtoImage", "src/PDFtoImage"] -RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +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 diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot b/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot index f29350e3..7bd1f988 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot @@ -3,11 +3,10 @@ WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build ARG BUILD_CONFIGURATION=Release -ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] COPY ["src/PDFtoImage", "src/PDFtoImage"] -RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=$TARGET_FRAMEWORK +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 diff --git a/src/Tests/Dockerfiles/linux b/src/Tests/Dockerfiles/linux index fd3d43ee..4f096b6a 100644 --- a/src/Tests/Dockerfiles/linux +++ b/src/Tests/Dockerfiles/linux @@ -1,4 +1,26 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +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 COPY . . -ENTRYPOINT ["dotnet", "test", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file +WORKDIR "/src/src" +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 apt update && apt install -y \ + clang \ + zlib1g-dev +RUN dotnet publish "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore -f $TARGET_FRAMEWORK + +FROM base AS final +ARG TARGET_FRAMEWORK=net8.0 +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "test", "publish/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file diff --git a/src/Tests/Dockerfiles/windows b/src/Tests/Dockerfiles/windows index 5d5e8cc9..029e5b86 100644 --- a/src/Tests/Dockerfiles/windows +++ b/src/Tests/Dockerfiles/windows @@ -1,4 +1,26 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 +FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 AS base WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 AS build +ARG BUILD_CONFIGURATION=Release +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 COPY . . -ENTRYPOINT ["dotnet", "test", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file +WORKDIR "/src/src" +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 apt update && apt install -y \ + clang \ + zlib1g-dev +RUN dotnet publish "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore -f $TARGET_FRAMEWORK + +FROM base AS final +ARG TARGET_FRAMEWORK=net8.0 +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "test", "publish/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file From 5b4241590ccda43b3236805ab4ce4db0bc83c032 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 10:26:42 +0200 Subject: [PATCH 11/42] Update dockerfiles --- .github/workflows/dotnet.yml | 32 ++++++++++++++++---------------- src/Tests/Dockerfiles/linux | 3 --- src/Tests/Dockerfiles/windows | 3 --- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ad5c1ffd..084fcada 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -244,30 +244,30 @@ jobs: uses: actions/checkout@main with: fetch-depth: 0 - - name: aotconsole linux + - name: console linux if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/linux . && docker run --rm -t aotconsole - - name: aotconsole linux-chiseled + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux . && docker run --rm -t console + - name: console linux-chiseled if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled . && docker run --rm -t aotconsole - - name: aotconsole linux-aot + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled . && docker run --rm -t console + - name: console linux-aot if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot . && docker run --rm -t aotconsole - - name: aotconsole linux-aot-chiseled + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot . && docker run --rm -t console + - name: console linux-aot-chiseled if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled . && docker run --rm -t aotconsole - - name: aotconsole windows + 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 aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/windows . && docker run --rm -t aotconsole - - name: aotconsole windows-aot + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/windows . && docker run --rm -t console + - name: console windows-aot if: runner.os == 'Windows' && (success() || failure()) - run: docker build -t aotconsole -f src/FrameworkTests/AotConsole/Dockerfiles/windows-aot . && docker run --rm -t aotconsole - - name: test-client linux + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/windows-aot . && docker run --rm -t console + - name: unittests linux if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t test-client --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 test-client net8.0/PDFtoImage.Tests.dll - - name: test-client windows + 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 net8.0/PDFtoImage.Tests.dll + - name: unittests windows if: runner.os == 'Windows' && (success() || failure()) - run: docker build -t test-client --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 test-client net8.0/PDFtoImage.Tests.dll + 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 net8.0/PDFtoImage.Tests.dll - name: Upload test results if: success() || failure() uses: actions/upload-artifact@main diff --git a/src/Tests/Dockerfiles/linux b/src/Tests/Dockerfiles/linux index 4f096b6a..b06c55af 100644 --- a/src/Tests/Dockerfiles/linux +++ b/src/Tests/Dockerfiles/linux @@ -14,9 +14,6 @@ RUN dotnet build "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/build/$T FROM build AS publish ARG BUILD_CONFIGURATION=Release -RUN apt update && apt install -y \ - clang \ - zlib1g-dev RUN dotnet publish "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore -f $TARGET_FRAMEWORK FROM base AS final diff --git a/src/Tests/Dockerfiles/windows b/src/Tests/Dockerfiles/windows index 029e5b86..3c571ae1 100644 --- a/src/Tests/Dockerfiles/windows +++ b/src/Tests/Dockerfiles/windows @@ -14,9 +14,6 @@ RUN dotnet build "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/build/$T FROM build AS publish ARG BUILD_CONFIGURATION=Release -RUN apt update && apt install -y \ - clang \ - zlib1g-dev RUN dotnet publish "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore -f $TARGET_FRAMEWORK FROM base AS final From 62c9016c6db1af7994ff5622d7c5a5eeb38d3388 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 10:32:10 +0200 Subject: [PATCH 12/42] Update workflow --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 084fcada..37fe9bcd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -278,7 +278,7 @@ jobs: retention-days: 1 publish-test-results: name: Publish tests results - needs: test + needs: [test, docker] runs-on: ubuntu-latest permissions: checks: write From f08a4217fa1ca394034c07c125d7dfe88edd6b3d Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 10:36:46 +0200 Subject: [PATCH 13/42] Update workflows --- .github/workflows/dotnet.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 37fe9bcd..36988192 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -265,6 +265,8 @@ jobs: - name: unittests linux if: runner.os == 'Linux' && (success() || failure()) 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 net8.0/PDFtoImage.Tests.dll + - name: docker system prune + run: docker system prune -a -f - 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 net8.0/PDFtoImage.Tests.dll From 11c6d3aebae6e446f98c01972a3096fc7c360f3d Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 10:38:51 +0200 Subject: [PATCH 14/42] Update workflows --- .github/workflows/dotnet.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 36988192..af51237f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -244,30 +244,30 @@ jobs: uses: actions/checkout@main with: fetch-depth: 0 - - name: console linux + - name: console (linux) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux . && docker run --rm -t console - - name: console linux-chiseled + - name: console (linux-chiseled) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled . && docker run --rm -t console - - name: console linux-aot + - name: console (linux-aot) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot . && docker run --rm -t console - - name: console linux-aot-chiseled + - name: console (linux-aot-chiseled) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled . && docker run --rm -t console - - name: console windows + - 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 - - name: console windows-aot + - 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 - - name: unittests linux - if: runner.os == 'Linux' && (success() || failure()) - 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 net8.0/PDFtoImage.Tests.dll - name: docker system prune run: docker system prune -a -f - - name: unittests windows + - name: unittests (linux) + if: runner.os == 'Linux' && (success() || failure()) + 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 net8.0/PDFtoImage.Tests.dll + - 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 net8.0/PDFtoImage.Tests.dll - name: Upload test results From a885b2775e49b6d935ff3bdf16d3b8a16f1f25b4 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 10:45:48 +0200 Subject: [PATCH 15/42] Update workflows --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index af51237f..d192761a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -266,10 +266,10 @@ jobs: run: docker system prune -a -f - name: unittests (linux) if: runner.os == 'Linux' && (success() || failure()) - 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 net8.0/PDFtoImage.Tests.dll + 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 net8.0/PDFtoImage.Tests.dll + 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 - name: Upload test results if: success() || failure() uses: actions/upload-artifact@main From 9700b1015c2c4b798dffa698bf89ee6d15a4436a Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 11:03:52 +0200 Subject: [PATCH 16/42] Test dockerfile --- src/FrameworkTests/AotConsole/Program.cs | 1 + src/Tests/Dockerfiles/linux | 3 +-- src/Tests/Dockerfiles/windows | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/FrameworkTests/AotConsole/Program.cs b/src/FrameworkTests/AotConsole/Program.cs index 43ef85a7..06e8e72b 100644 --- a/src/FrameworkTests/AotConsole/Program.cs +++ b/src/FrameworkTests/AotConsole/Program.cs @@ -7,6 +7,7 @@ public class Program public static void Main() { + throw new NotImplementedException(); Directory.SetCurrentDirectory(Path.GetDirectoryName(AppContext.BaseDirectory)!); using var input = new FileStream("SocialPreview.pdf", FileMode.Open, FileAccess.Read); using var bitmap = PDFtoImage.Conversion.ToImage(input); diff --git a/src/Tests/Dockerfiles/linux b/src/Tests/Dockerfiles/linux index b06c55af..2d99da54 100644 --- a/src/Tests/Dockerfiles/linux +++ b/src/Tests/Dockerfiles/linux @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base +FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine3.20 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build @@ -17,7 +17,6 @@ ARG BUILD_CONFIGURATION=Release RUN dotnet publish "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore -f $TARGET_FRAMEWORK FROM base AS final -ARG TARGET_FRAMEWORK=net8.0 WORKDIR /app COPY --from=publish /app . ENTRYPOINT ["dotnet", "test", "publish/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file diff --git a/src/Tests/Dockerfiles/windows b/src/Tests/Dockerfiles/windows index 3c571ae1..9f08d7dc 100644 --- a/src/Tests/Dockerfiles/windows +++ b/src/Tests/Dockerfiles/windows @@ -17,7 +17,6 @@ ARG BUILD_CONFIGURATION=Release RUN dotnet publish "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore -f $TARGET_FRAMEWORK FROM base AS final -ARG TARGET_FRAMEWORK=net8.0 WORKDIR /app COPY --from=publish /app . ENTRYPOINT ["dotnet", "test", "publish/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file From 42a32103a979a26da955b76b9a9d6f6874d2bdbf Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 11:11:29 +0200 Subject: [PATCH 17/42] Update workflows --- .github/workflows/dotnet.yml | 3 ++- src/FrameworkTests/AotConsole/Program.cs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d192761a..c576c12d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -263,6 +263,7 @@ jobs: if: runner.os == 'Windows' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/windows-aot . && docker run --rm -t console - name: docker system prune + if: success() || failure() run: docker system prune -a -f - name: unittests (linux) if: runner.os == 'Linux' && (success() || failure()) @@ -274,7 +275,7 @@ jobs: if: success() || failure() uses: actions/upload-artifact@main with: - name: Test results (docker ${{ matrix.os }}) + name: Test results (${{ matrix.os }}; docker) path: ./**/*.trx if-no-files-found: error retention-days: 1 diff --git a/src/FrameworkTests/AotConsole/Program.cs b/src/FrameworkTests/AotConsole/Program.cs index 06e8e72b..43ef85a7 100644 --- a/src/FrameworkTests/AotConsole/Program.cs +++ b/src/FrameworkTests/AotConsole/Program.cs @@ -7,7 +7,6 @@ public class Program public static void Main() { - throw new NotImplementedException(); Directory.SetCurrentDirectory(Path.GetDirectoryName(AppContext.BaseDirectory)!); using var input = new FileStream("SocialPreview.pdf", FileMode.Open, FileAccess.Read); using var bitmap = PDFtoImage.Conversion.ToImage(input); From 3dfb1c3a0119ab8143c47899f72b92d4a15f151e Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 12:03:02 +0200 Subject: [PATCH 18/42] Update workflows --- .github/workflows/dotnet.yml | 6 +++--- src/FrameworkTests/AotConsole/Dockerfiles/windows | 2 +- src/FrameworkTests/AotConsole/Dockerfiles/windows-aot | 6 +++--- src/Tests/Dockerfiles/windows | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c576c12d..09dc16ab 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -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 @@ -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 diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows b/src/FrameworkTests/AotConsole/Dockerfiles/windows index 73aae040..0f830d4c 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows @@ -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 diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot b/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot index 7bd1f988..adc64d1c 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot @@ -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 @@ -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 diff --git a/src/Tests/Dockerfiles/windows b/src/Tests/Dockerfiles/windows index 9f08d7dc..0ac16bf9 100644 --- a/src/Tests/Dockerfiles/windows +++ b/src/Tests/Dockerfiles/windows @@ -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 From 5cfce89d423a23cc6e7fb53e3d76c2cc58179de1 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 12:10:37 +0200 Subject: [PATCH 19/42] Update workflows --- .github/workflows/dotnet.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 09dc16ab..93f7cc4b 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -258,9 +258,11 @@ 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()) + shell: pwsh 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()) + shell: pwsh 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() @@ -270,6 +272,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()) + shell: pwsh 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() From d1d26630ca3f4daf5bbadf89801e27a0635bd0ab Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 12:14:23 +0200 Subject: [PATCH 20/42] Update workflow --- .github/workflows/dotnet.yml | 9 +++------ windows | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 windows diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 93f7cc4b..467a1fc7 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -258,12 +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()) - shell: pwsh - run: copy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows" windows && docker build -t console -f windows . && docker run --rm -t console + run: xcopy /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()) - shell: pwsh - run: copy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-aot" windows-aot && docker build -t console -f windows . && docker run --rm -t console + run: xcopy /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 @@ -272,8 +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()) - shell: pwsh - 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 + run: xcopy /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 diff --git a/windows b/windows new file mode 100644 index 00000000..0f830d4c --- /dev/null +++ b/windows @@ -0,0 +1,17 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] +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 + +FROM base AS final +WORKDIR /app +COPY --from=build /app/build . +ENTRYPOINT ["dotnet", "PDFtoImage.FrameworkTests.AotConsole.dll"] \ No newline at end of file From 029c68abbb2218712909771748ae6dfecb93c4dc Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 12:58:21 +0200 Subject: [PATCH 21/42] Update dockerfiles --- src/FrameworkTests/AotConsole/Dockerfiles/linux | 2 +- src/FrameworkTests/AotConsole/Dockerfiles/linux-aot | 2 +- src/FrameworkTests/AotConsole/Dockerfiles/windows | 2 +- src/FrameworkTests/AotConsole/Dockerfiles/windows-aot | 2 +- src/Tests/Dockerfiles/linux | 2 +- src/Tests/Dockerfiles/windows | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux b/src/FrameworkTests/AotConsole/Dockerfiles/linux index e02d3f15..9811586d 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/linux +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base +FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine3.20 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot index 7d4d6ac1..9d0ab460 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/runtime-deps:8.0 AS base +FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine3.20 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows b/src/FrameworkTests/AotConsole/Dockerfiles/windows index 0f830d4c..72a721be 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base +FROM mcr.microsoft.com/dotnet/runtime:8.0-windowsservercore-ltsc2022 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot b/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot index adc64d1c..4bfad212 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-nanoserver-ltsc2022 AS base +FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-windowsservercore-ltsc2022 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build diff --git a/src/Tests/Dockerfiles/linux b/src/Tests/Dockerfiles/linux index 2d99da54..7f1a3ffc 100644 --- a/src/Tests/Dockerfiles/linux +++ b/src/Tests/Dockerfiles/linux @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine3.20 AS base +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build diff --git a/src/Tests/Dockerfiles/windows b/src/Tests/Dockerfiles/windows index 0ac16bf9..b050593b 100644 --- a/src/Tests/Dockerfiles/windows +++ b/src/Tests/Dockerfiles/windows @@ -1,7 +1,7 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 AS base +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build ARG BUILD_CONFIGURATION=Release ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src From 79b86464b8f137dd8bc07c1a258ae2447f65b311 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 18:38:32 +0200 Subject: [PATCH 22/42] Update dockerfiles --- .github/workflows/dotnet.yml | 21 +++++++++++++----- .../AotConsole/Dockerfiles/windows-nanoserver | 0 .../Dockerfiles/windows-nanoserver-aot | 21 ++++++++++++++++++ .../{windows => windows-servercore} | 0 .../{windows-aot => windows-servercore-aot} | 0 src/Tests/Dockerfiles/windows-nanoserver | 22 +++++++++++++++++++ .../{windows => windows-servercore} | 0 7 files changed, 58 insertions(+), 6 deletions(-) rename windows => src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver (100%) create mode 100644 src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot rename src/FrameworkTests/AotConsole/Dockerfiles/{windows => windows-servercore} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{windows-aot => windows-servercore-aot} (100%) create mode 100644 src/Tests/Dockerfiles/windows-nanoserver rename src/Tests/Dockerfiles/{windows => windows-servercore} (100%) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 467a1fc7..f94e83ae 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -256,21 +256,30 @@ jobs: - name: console (linux-aot-chiseled) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled . && docker run --rm -t console - - name: console (windows) + - name: console (servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows" windows && docker build -t console -f windows . && docker run --rm -t console - - name: console (windows-aot) + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore" windows-servercore && docker build -t console -f windows-servercore . && docker run --rm -t console + - name: console (servercore-aot) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-aot" windows-aot && docker build -t console -f windows . && docker run --rm -t console + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot" windows-servercore-aot && docker build -t console -f windows-servercore-aot . && docker run --rm -t console + - name: console (nanoserver) + if: runner.os == 'Windows' && (success() || failure()) + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t console -f windows-nanoserver . && docker run --rm -t console + - name: console (nanoserver-aot) + if: runner.os == 'Windows' && (success() || failure()) + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot" windows-nanoserver-aot && docker build -t console -f windows-nanoserver-aot . && docker run --rm -t console - name: docker system prune if: success() || failure() run: docker system prune -a -f - name: unittests (linux) if: runner.os == 'Linux' && (success() || failure()) 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) + - name: unittests (servercore) + if: runner.os == 'Windows' && (success() || failure()) + run: xcopy /y "src\Tests\Dockerfiles\windows-servercore" windows-servercore && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + - name: unittests (nanoserver) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /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 + run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver . && 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 diff --git a/windows b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver similarity index 100% rename from windows rename to src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot new file mode 100644 index 00000000..8fff9507 --- /dev/null +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot @@ -0,0 +1,21 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] +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 + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["PDFtoImage.FrameworkTests.AotConsole.exe"] \ No newline at end of file diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/windows rename to src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-aot b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/windows-aot rename to src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot diff --git a/src/Tests/Dockerfiles/windows-nanoserver b/src/Tests/Dockerfiles/windows-nanoserver new file mode 100644 index 00000000..214b5e39 --- /dev/null +++ b/src/Tests/Dockerfiles/windows-nanoserver @@ -0,0 +1,22 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +ARG BUILD_CONFIGURATION=Release +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% +COPY . . +WORKDIR "/src/src" +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% + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "test", "publish/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file diff --git a/src/Tests/Dockerfiles/windows b/src/Tests/Dockerfiles/windows-servercore similarity index 100% rename from src/Tests/Dockerfiles/windows rename to src/Tests/Dockerfiles/windows-servercore From 5db7133fb829685ec061a83deed728ae381b70ce Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 19:01:10 +0200 Subject: [PATCH 23/42] Update workflow --- .github/workflows/dotnet.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f94e83ae..b3fc06f1 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -258,16 +258,16 @@ jobs: run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled . && docker run --rm -t console - name: console (servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore" windows-servercore && docker build -t console -f windows-servercore . && docker run --rm -t console + run: xcopy /y /i "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore" windows-servercore && docker build -t console -f windows-servercore . && docker run --rm -t console - name: console (servercore-aot) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot" windows-servercore-aot && docker build -t console -f windows-servercore-aot . && docker run --rm -t console + run: xcopy /y /i "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot" windows-servercore-aot && docker build -t console -f windows-servercore-aot . && docker run --rm -t console - name: console (nanoserver) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t console -f windows-nanoserver . && docker run --rm -t console + run: xcopy /y /i "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t console -f windows-nanoserver . && docker run --rm -t console - name: console (nanoserver-aot) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot" windows-nanoserver-aot && docker build -t console -f windows-nanoserver-aot . && docker run --rm -t console + run: xcopy /y /i "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot" windows-nanoserver-aot && docker build -t console -f windows-nanoserver-aot . && docker run --rm -t console - name: docker system prune if: success() || failure() run: docker system prune -a -f @@ -276,10 +276,10 @@ 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 (servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\Tests\Dockerfiles\windows-servercore" windows-servercore && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y /i "src\Tests\Dockerfiles\windows-servercore" windows-servercore && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: unittests (nanoserver) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y /i "src\Tests\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver . && 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 From 86d35631b397244f2fd02e19d3323146245b49e5 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 19:05:17 +0200 Subject: [PATCH 24/42] Update workflow --- .github/workflows/dotnet.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b3fc06f1..306e2789 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -258,16 +258,16 @@ jobs: run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled . && docker run --rm -t console - name: console (servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /i "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore" windows-servercore && docker build -t console -f windows-servercore . && docker run --rm -t console + run: xcopy /y /-i "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore" windows-servercore && docker build -t console -f windows-servercore . && docker run --rm -t console - name: console (servercore-aot) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /i "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot" windows-servercore-aot && docker build -t console -f windows-servercore-aot . && docker run --rm -t console + run: xcopy /y /-i "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot" windows-servercore-aot && docker build -t console -f windows-servercore-aot . && docker run --rm -t console - name: console (nanoserver) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /i "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t console -f windows-nanoserver . && docker run --rm -t console + run: xcopy /y /-i "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t console -f windows-nanoserver . && docker run --rm -t console - name: console (nanoserver-aot) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /i "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot" windows-nanoserver-aot && docker build -t console -f windows-nanoserver-aot . && docker run --rm -t console + run: xcopy /y /-i "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot" windows-nanoserver-aot && docker build -t console -f windows-nanoserver-aot . && docker run --rm -t console - name: docker system prune if: success() || failure() run: docker system prune -a -f @@ -276,10 +276,10 @@ 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 (servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /i "src\Tests\Dockerfiles\windows-servercore" windows-servercore && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y /-i "src\Tests\Dockerfiles\windows-servercore" windows-servercore && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: unittests (nanoserver) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /i "src\Tests\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y /-i "src\Tests\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver . && 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 From f8d6bc20111fb9d5d64f2a5b44094c4b3d40c586 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 19:15:33 +0200 Subject: [PATCH 25/42] Update dockerfiles --- .github/workflows/dotnet.yml | 22 +++++++++---------- ...chiseled => linux-aot-chiseled.dockerfile} | 0 .../{linux-aot => linux-aot.dockerfile} | 0 ...nux-chiseled => linux-chiseled.dockerfile} | 0 .../Dockerfiles/{linux => linux.dockerfile} | 0 ...-aot => windows-nanoserver-aot.dockerfile} | 0 ...noserver => windows-nanoserver.dockerfile} | 0 ...-aot => windows-servercore-aot.dockerfile} | 0 ...rvercore => windows-servercore.dockerfile} | 0 .../Dockerfiles/{linux => linux.dockerfile} | 0 ...noserver => windows-nanoserver.dockerfile} | 0 ...rvercore => windows-servercore.dockerfile} | 0 windows-nanoserver-aot | 21 ++++++++++++++++++ 13 files changed, 32 insertions(+), 11 deletions(-) rename src/FrameworkTests/AotConsole/Dockerfiles/{linux-aot-chiseled => linux-aot-chiseled.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{linux-aot => linux-aot.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{linux-chiseled => linux-chiseled.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{linux => linux.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{windows-nanoserver-aot => windows-nanoserver-aot.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{windows-nanoserver => windows-nanoserver.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{windows-servercore-aot => windows-servercore-aot.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{windows-servercore => windows-servercore.dockerfile} (100%) rename src/Tests/Dockerfiles/{linux => linux.dockerfile} (100%) rename src/Tests/Dockerfiles/{windows-nanoserver => windows-nanoserver.dockerfile} (100%) rename src/Tests/Dockerfiles/{windows-servercore => windows-servercore.dockerfile} (100%) create mode 100644 windows-nanoserver-aot diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 306e2789..82c02777 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -246,40 +246,40 @@ jobs: fetch-depth: 0 - name: console (linux) if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux . && docker run --rm -t console + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile . && docker run --rm -t console - name: console (linux-chiseled) if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled . && docker run --rm -t console + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled.dockerfile . && docker run --rm -t console - name: console (linux-aot) if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot . && docker run --rm -t console + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile . && docker run --rm -t console - name: console (linux-aot-chiseled) if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled . && docker run --rm -t console + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled.dockerfile . && docker run --rm -t console - name: console (servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /-i "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore" windows-servercore && docker build -t console -f windows-servercore . && docker run --rm -t console + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore.dockerfile" windows-servercore.dockerfile && docker build -t console -f windows-servercore.dockerfile . && docker run --rm -t console - name: console (servercore-aot) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /-i "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot" windows-servercore-aot && docker build -t console -f windows-servercore-aot . && docker run --rm -t console + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot.dockerfile" windows-servercore-aot.dockerfile && docker build -t console -f windows-servercore-aot.dockerfile . && docker run --rm -t console - name: console (nanoserver) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /-i "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t console -f windows-nanoserver . && docker run --rm -t console + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver.dockerfile" windows-nanoserver.dockerfile && docker build -t console -f windows-nanoserver.dockerfile . && docker run --rm -t console - name: console (nanoserver-aot) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /-i "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot" windows-nanoserver-aot && docker build -t console -f windows-nanoserver-aot . && docker run --rm -t console + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot.dockerfile" windows-nanoserver-aot.dockerfile && docker build -t console -f windows-nanoserver-aot.dockerfile . && docker run --rm -t console - name: docker system prune if: success() || failure() run: docker system prune -a -f - name: unittests (linux) if: runner.os == 'Linux' && (success() || failure()) - 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 + run: docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f src/Tests/Dockerfiles/linux.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: unittests (servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /-i "src\Tests\Dockerfiles\windows-servercore" windows-servercore && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y "src\Tests\Dockerfiles\windows-servercore.dockerfile" windows-servercore.dockerfile && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: unittests (nanoserver) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y /-i "src\Tests\Dockerfiles\windows-nanoserver" windows-nanoserver && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver.dockerfile" windows-nanoserver.dockerfile && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver.dockerfile . && 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 diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled rename to src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/linux-aot rename to src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled b/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled rename to src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux b/src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/linux rename to src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot rename to src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver rename to src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot rename to src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore rename to src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile diff --git a/src/Tests/Dockerfiles/linux b/src/Tests/Dockerfiles/linux.dockerfile similarity index 100% rename from src/Tests/Dockerfiles/linux rename to src/Tests/Dockerfiles/linux.dockerfile diff --git a/src/Tests/Dockerfiles/windows-nanoserver b/src/Tests/Dockerfiles/windows-nanoserver.dockerfile similarity index 100% rename from src/Tests/Dockerfiles/windows-nanoserver rename to src/Tests/Dockerfiles/windows-nanoserver.dockerfile diff --git a/src/Tests/Dockerfiles/windows-servercore b/src/Tests/Dockerfiles/windows-servercore.dockerfile similarity index 100% rename from src/Tests/Dockerfiles/windows-servercore rename to src/Tests/Dockerfiles/windows-servercore.dockerfile diff --git a/windows-nanoserver-aot b/windows-nanoserver-aot new file mode 100644 index 00000000..8fff9507 --- /dev/null +++ b/windows-nanoserver-aot @@ -0,0 +1,21 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] +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 + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["PDFtoImage.FrameworkTests.AotConsole.exe"] \ No newline at end of file From f0636678c118302be2bdee407898b7c502dd8e7a Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 19:19:56 +0200 Subject: [PATCH 26/42] Update workflow --- .github/workflows/dotnet.yml | 12 ++++++------ windows-nanoserver-aot | 21 --------------------- 2 files changed, 6 insertions(+), 27 deletions(-) delete mode 100644 windows-nanoserver-aot diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 82c02777..8357fc2f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -258,16 +258,16 @@ jobs: run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled.dockerfile . && docker run --rm -t console - name: console (servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore.dockerfile" windows-servercore.dockerfile && docker build -t console -f windows-servercore.dockerfile . && docker run --rm -t console + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore.dockerfile" . && docker build -t console -f windows-servercore.dockerfile . && docker run --rm -t console - name: console (servercore-aot) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot.dockerfile" windows-servercore-aot.dockerfile && docker build -t console -f windows-servercore-aot.dockerfile . && docker run --rm -t console + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot.dockerfile" . && docker build -t console -f windows-servercore-aot.dockerfile . && docker run --rm -t console - name: console (nanoserver) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver.dockerfile" windows-nanoserver.dockerfile && docker build -t console -f windows-nanoserver.dockerfile . && docker run --rm -t console + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver.dockerfile" . && docker build -t console -f windows-nanoserver.dockerfile . && docker run --rm -t console - name: console (nanoserver-aot) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot.dockerfile" windows-nanoserver-aot.dockerfile && docker build -t console -f windows-nanoserver-aot.dockerfile . && docker run --rm -t console + run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot.dockerfile" . && docker build -t console -f windows-nanoserver-aot.dockerfile . && docker run --rm -t console - name: docker system prune if: success() || failure() run: docker system prune -a -f @@ -276,10 +276,10 @@ jobs: run: docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f src/Tests/Dockerfiles/linux.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: unittests (servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\Tests\Dockerfiles\windows-servercore.dockerfile" windows-servercore.dockerfile && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y "src\Tests\Dockerfiles\windows-servercore.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: unittests (nanoserver) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver.dockerfile" windows-nanoserver.dockerfile && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver.dockerfile . && 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 diff --git a/windows-nanoserver-aot b/windows-nanoserver-aot deleted file mode 100644 index 8fff9507..00000000 --- a/windows-nanoserver-aot +++ /dev/null @@ -1,21 +0,0 @@ -FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base -WORKDIR /app - -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build -ARG BUILD_CONFIGURATION=Release -WORKDIR /src -COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] -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 - -FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore - -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["PDFtoImage.FrameworkTests.AotConsole.exe"] \ No newline at end of file From 2262e1d477a67e0fb688380fd9d014af956f02cf Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 19:29:36 +0200 Subject: [PATCH 27/42] Update workflows --- src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile | 2 +- src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile index 9d0ab460..7d4d6ac1 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine3.20 AS base +FROM mcr.microsoft.com/dotnet/runtime-deps:8.0 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile index 9811586d..e02d3f15 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine3.20 AS base +FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build From d31abab5005909b807bc98b3dced280d3aceb6a9 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 19:38:21 +0200 Subject: [PATCH 28/42] Update workflows --- .github/workflows/dotnet.yml | 10 +++++----- .../{linux-aot.dockerfile => ubuntu-aot.dockerfile} | 0 ...seled.dockerfile => ubuntu-chiseled-aot.dockerfile} | 0 ...-chiseled.dockerfile => ubuntu-chiseled.dockerfile} | 0 .../{linux.dockerfile => ubuntu.dockerfile} | 0 .../{linux.dockerfile => ubuntu.dockerfile} | 0 6 files changed, 5 insertions(+), 5 deletions(-) rename src/FrameworkTests/AotConsole/Dockerfiles/{linux-aot.dockerfile => ubuntu-aot.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{linux-aot-chiseled.dockerfile => ubuntu-chiseled-aot.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{linux-chiseled.dockerfile => ubuntu-chiseled.dockerfile} (100%) rename src/FrameworkTests/AotConsole/Dockerfiles/{linux.dockerfile => ubuntu.dockerfile} (100%) rename src/Tests/Dockerfiles/{linux.dockerfile => ubuntu.dockerfile} (100%) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 8357fc2f..129998f5 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -246,16 +246,16 @@ jobs: fetch-depth: 0 - name: console (linux) if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile . && docker run --rm -t console + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile . && docker run --rm -t console - name: console (linux-chiseled) if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled.dockerfile . && docker run --rm -t console + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled.dockerfile . && docker run --rm -t console - name: console (linux-aot) if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile . && docker run --rm -t console + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-aot.dockerfile . && docker run --rm -t console - name: console (linux-aot-chiseled) if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled.dockerfile . && docker run --rm -t console + run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled-aot.dockerfile . && docker run --rm -t console - name: console (servercore) if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore.dockerfile" . && docker build -t console -f windows-servercore.dockerfile . && docker run --rm -t console @@ -273,7 +273,7 @@ jobs: run: docker system prune -a -f - name: unittests (linux) if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f src/Tests/Dockerfiles/linux.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f src/Tests/Dockerfiles/ubuntu.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: unittests (servercore) if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\Tests\Dockerfiles\windows-servercore.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-aot.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/linux-aot.dockerfile rename to src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-aot.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled-aot.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/linux-aot-chiseled.dockerfile rename to src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled-aot.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/linux-chiseled.dockerfile rename to src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled.dockerfile diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile similarity index 100% rename from src/FrameworkTests/AotConsole/Dockerfiles/linux.dockerfile rename to src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile diff --git a/src/Tests/Dockerfiles/linux.dockerfile b/src/Tests/Dockerfiles/ubuntu.dockerfile similarity index 100% rename from src/Tests/Dockerfiles/linux.dockerfile rename to src/Tests/Dockerfiles/ubuntu.dockerfile From a74532dc984a3d61b4e3fc6b60778d8151c38166 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Wed, 3 Jul 2024 19:40:32 +0200 Subject: [PATCH 29/42] Update workflows --- .github/workflows/dotnet.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 129998f5..19268af3 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -244,40 +244,40 @@ jobs: uses: actions/checkout@main with: fetch-depth: 0 - - name: console (linux) + - name: console (ubuntu) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile . && docker run --rm -t console - - name: console (linux-chiseled) + - name: console (ubuntu-chiseled) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled.dockerfile . && docker run --rm -t console - - name: console (linux-aot) + - name: console (ubuntu-aot) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-aot.dockerfile . && docker run --rm -t console - - name: console (linux-aot-chiseled) + - name: console (ubuntu-chiseled-aot) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled-aot.dockerfile . && docker run --rm -t console - - name: console (servercore) + - name: console (windows-servercore) if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore.dockerfile" . && docker build -t console -f windows-servercore.dockerfile . && docker run --rm -t console - - name: console (servercore-aot) + - name: console (windows-servercore-aot) if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot.dockerfile" . && docker build -t console -f windows-servercore-aot.dockerfile . && docker run --rm -t console - - name: console (nanoserver) + - name: console (windows-nanoserver) if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver.dockerfile" . && docker build -t console -f windows-nanoserver.dockerfile . && docker run --rm -t console - - name: console (nanoserver-aot) + - name: console (windows-nanoserver-aot) if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot.dockerfile" . && docker build -t console -f windows-nanoserver-aot.dockerfile . && docker run --rm -t console - name: docker system prune if: success() || failure() run: docker system prune -a -f - - name: unittests (linux) + - name: unittests (ubuntu) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f src/Tests/Dockerfiles/ubuntu.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - - name: unittests (servercore) + - name: unittests (windows-servercore) if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\Tests\Dockerfiles\windows-servercore.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - - name: unittests (nanoserver) + - name: unittests (windows-nanoserver) if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: Upload test results From 4ff5a6c149d34841261855f08ee5953779463cb7 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 13:09:28 +0200 Subject: [PATCH 30/42] Update dockerfiles --- .github/workflows/dotnet.yml | 6 ++--- .../windows-nanoserver-aot.dockerfile | 25 +++++++++++++++++-- .../windows-servercore-aot.dockerfile | 25 +++++++++++++++++-- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 19268af3..9e0ef5d8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -263,10 +263,10 @@ jobs: if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot.dockerfile" . && docker build -t console -f windows-servercore-aot.dockerfile . && docker run --rm -t console - name: console (windows-nanoserver) - if: runner.os == 'Windows' && (success() || failure()) + if: false && runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver.dockerfile" . && docker build -t console -f windows-nanoserver.dockerfile . && docker run --rm -t console - name: console (windows-nanoserver-aot) - if: runner.os == 'Windows' && (success() || failure()) + if: false && runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot.dockerfile" . && docker build -t console -f windows-nanoserver-aot.dockerfile . && docker run --rm -t console - name: docker system prune if: success() || failure() @@ -278,7 +278,7 @@ jobs: if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\Tests\Dockerfiles\windows-servercore.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: unittests (windows-nanoserver) - if: runner.os == 'Windows' && (success() || failure()) + if: false && runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: Upload test results if: success() || failure() diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile index 8fff9507..7fd50dcd 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile @@ -1,7 +1,28 @@ -FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base +FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS sdk +# Restore the default Windows shell for correct batch processing. +SHELL ["cmd", "/S", "/C"] + +RUN ` + # Download the Build Tools bootstrapper. + curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe ` + ` + # Install Build Tools with the Microsoft.VisualStudio.Workload.VCTools workload + && (start /w vs_buildtools.exe --quiet --wait --norestart --nocache ` + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ` + --add Microsoft.VisualStudio.Workload.VCTools ` + --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 ` + --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 ` + --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 ` + --remove Microsoft.VisualStudio.Component.Windows81SDK ` + || IF "%ERRORLEVEL%"=="3010" EXIT 0) ` + ` + # Cleanup + && del /q vs_buildtools.exe + +FROM sdk AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile index 4bfad212..ee4dab73 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile @@ -1,7 +1,28 @@ -FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-windowsservercore-ltsc2022 AS base +FROM mcr.microsoft.com/windows/servercore:ltsc2022 WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS sdk +# Restore the default Windows shell for correct batch processing. +SHELL ["cmd", "/S", "/C"] + +RUN ` + # Download the Build Tools bootstrapper. + curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe ` + ` + # Install Build Tools with the Microsoft.VisualStudio.Workload.VCTools workload + && (start /w vs_buildtools.exe --quiet --wait --norestart --nocache ` + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ` + --add Microsoft.VisualStudio.Workload.VCTools ` + --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 ` + --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 ` + --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 ` + --remove Microsoft.VisualStudio.Component.Windows81SDK ` + || IF "%ERRORLEVEL%"=="3010" EXIT 0) ` + ` + # Cleanup + && del /q vs_buildtools.exe + +FROM sdk AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] From e209db6d188e21b80efb2948b32bf72fc969fe43 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 14:01:44 +0200 Subject: [PATCH 31/42] Update dockerfiles --- .../Dockerfiles/ubuntu-aot.dockerfile | 5 +++- .../ubuntu-chiseled-aot.dockerfile | 5 +++- .../Dockerfiles/ubuntu-chiseled.dockerfile | 5 +++- .../AotConsole/Dockerfiles/ubuntu.dockerfile | 5 +++- .../windows-nanoserver-aot.dockerfile | 29 +++++++++---------- .../Dockerfiles/windows-nanoserver.dockerfile | 4 ++- .../windows-servercore-aot.dockerfile | 29 +++++++++---------- .../Dockerfiles/windows-servercore.dockerfile | 4 ++- src/Tests/Dockerfiles/ubuntu.dockerfile | 7 ++++- .../Dockerfiles/windows-nanoserver.dockerfile | 5 +++- .../Dockerfiles/windows-servercore.dockerfile | 5 +++- 11 files changed, 62 insertions(+), 41 deletions(-) diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-aot.dockerfile index 7d4d6ac1..9046293f 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-aot.dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/runtime-deps:8.0 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -9,6 +9,9 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0 COPY . . WORKDIR "/src/src" + +FROM restore AS build +ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore FROM build AS publish diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled-aot.dockerfile index 4fec429e..b586fbed 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled-aot.dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-noble-chiseled AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -9,6 +9,9 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0 COPY . . WORKDIR "/src/src" + +FROM restore AS build +ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore FROM build AS publish diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled.dockerfile index adb3c40c..80cd1e32 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu-chiseled.dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0-noble-chiseled AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -9,6 +9,9 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0 COPY . . WORKDIR "/src/src" + +FROM restore AS build +ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore FROM base AS final diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile index e02d3f15..9ee297f7 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -9,6 +9,9 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0 COPY . . WORKDIR "/src/src" + +FROM restore AS build +ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore FROM base AS final diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile index 7fd50dcd..e72e47db 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile @@ -5,24 +5,19 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS sdk # Restore the default Windows shell for correct batch processing. SHELL ["cmd", "/S", "/C"] -RUN ` - # Download the Build Tools bootstrapper. - curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe ` - ` - # Install Build Tools with the Microsoft.VisualStudio.Workload.VCTools workload - && (start /w vs_buildtools.exe --quiet --wait --norestart --nocache ` - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ` - --add Microsoft.VisualStudio.Workload.VCTools ` - --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 ` - --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 ` - --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 ` - --remove Microsoft.VisualStudio.Component.Windows81SDK ` - || IF "%ERRORLEVEL%"=="3010" EXIT 0) ` - ` - # Cleanup +RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" +RUN (start /w vs_buildtools.exe --quiet --wait --norestart --nocache \ + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ + --add Microsoft.VisualStudio.Workload.VCTools \ + --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 \ + --remove Microsoft.VisualStudio.Component.Windows81SDK \ + || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ && del /q vs_buildtools.exe -FROM sdk AS build +FROM sdk AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -30,6 +25,8 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0 COPY . . WORKDIR "/src/src" + +FROM restore AS build RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore FROM build AS publish diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile index 0f830d4c..53fd91a4 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-ltsc2022 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -9,6 +9,8 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0 COPY . . WORKDIR "/src/src" + +FROM restore AS build RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore FROM base AS final diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile index ee4dab73..5eaebb03 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile @@ -5,24 +5,19 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS sdk # Restore the default Windows shell for correct batch processing. SHELL ["cmd", "/S", "/C"] -RUN ` - # Download the Build Tools bootstrapper. - curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe ` - ` - # Install Build Tools with the Microsoft.VisualStudio.Workload.VCTools workload - && (start /w vs_buildtools.exe --quiet --wait --norestart --nocache ` - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ` - --add Microsoft.VisualStudio.Workload.VCTools ` - --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 ` - --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 ` - --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 ` - --remove Microsoft.VisualStudio.Component.Windows81SDK ` - || IF "%ERRORLEVEL%"=="3010" EXIT 0) ` - ` - # Cleanup +RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" +RUN (start /w vs_buildtools.exe --quiet --wait --norestart --nocache \ + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ + --add Microsoft.VisualStudio.Workload.VCTools \ + --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 \ + --remove Microsoft.VisualStudio.Component.Windows81SDK \ + || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ && del /q vs_buildtools.exe -FROM sdk AS build +FROM sdk AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -30,6 +25,8 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0 COPY . . WORKDIR "/src/src" + +FROM restore AS build RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore FROM build AS publish diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile index 72a721be..073f16b8 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0-windowsservercore-ltsc2022 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -9,6 +9,8 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/FrameworkTests/AotConsole/AotConsole.csproj" /p:TargetFramework=net8.0 COPY . . WORKDIR "/src/src" + +FROM restore AS build RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore FROM base AS final diff --git a/src/Tests/Dockerfiles/ubuntu.dockerfile b/src/Tests/Dockerfiles/ubuntu.dockerfile index 7f1a3ffc..e6d0196d 100644 --- a/src/Tests/Dockerfiles/ubuntu.dockerfile +++ b/src/Tests/Dockerfiles/ubuntu.dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS restore ARG BUILD_CONFIGURATION=Release ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src @@ -10,10 +10,15 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/Tests/Tests.csproj" /p:TargetFramework=$TARGET_FRAMEWORK COPY . . WORKDIR "/src/src" + +FROM restore AS build +ARG BUILD_CONFIGURATION=Release +ARG TARGET_FRAMEWORK=net8.0 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 +ARG TARGET_FRAMEWORK=net8.0 RUN dotnet publish "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore -f $TARGET_FRAMEWORK FROM base AS final diff --git a/src/Tests/Dockerfiles/windows-nanoserver.dockerfile b/src/Tests/Dockerfiles/windows-nanoserver.dockerfile index 214b5e39..cdbef6f5 100644 --- a/src/Tests/Dockerfiles/windows-nanoserver.dockerfile +++ b/src/Tests/Dockerfiles/windows-nanoserver.dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS restore ARG BUILD_CONFIGURATION=Release ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src @@ -10,10 +10,13 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/Tests/Tests.csproj" /p:TargetFramework=%TARGET_FRAMEWORK% COPY . . WORKDIR "/src/src" + +FROM restore AS build 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 +ARG TARGET_FRAMEWORK=net8.0 RUN dotnet publish "./Tests/Tests.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore -f %TARGET_FRAMEWORK% FROM base AS final diff --git a/src/Tests/Dockerfiles/windows-servercore.dockerfile b/src/Tests/Dockerfiles/windows-servercore.dockerfile index b050593b..ef2df400 100644 --- a/src/Tests/Dockerfiles/windows-servercore.dockerfile +++ b/src/Tests/Dockerfiles/windows-servercore.dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS restore ARG BUILD_CONFIGURATION=Release ARG TARGET_FRAMEWORK=net8.0 WORKDIR /src @@ -10,10 +10,13 @@ COPY ["src/PDFtoImage", "src/PDFtoImage"] RUN dotnet restore "./src/Tests/Tests.csproj" /p:TargetFramework=%TARGET_FRAMEWORK% COPY . . WORKDIR "/src/src" + +FROM restore AS build 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 +ARG TARGET_FRAMEWORK=net8.0 RUN dotnet publish "./Tests/Tests.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore -f %TARGET_FRAMEWORK% FROM base AS final From bea792617f6d8d6c1e015515cf438e19239cf202 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 14:12:26 +0200 Subject: [PATCH 32/42] Update dockerfiles --- .../AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile | 1 + .../AotConsole/Dockerfiles/windows-nanoserver.dockerfile | 1 + .../AotConsole/Dockerfiles/windows-servercore-aot.dockerfile | 1 + .../AotConsole/Dockerfiles/windows-servercore.dockerfile | 1 + src/Tests/Dockerfiles/windows-nanoserver.dockerfile | 2 ++ src/Tests/Dockerfiles/windows-servercore.dockerfile | 2 ++ 6 files changed, 8 insertions(+) diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile index e72e47db..9ed2e0db 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile @@ -27,6 +27,7 @@ COPY . . WORKDIR "/src/src" FROM restore AS build +ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore FROM build AS publish diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile index 53fd91a4..f47edce8 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver.dockerfile @@ -11,6 +11,7 @@ COPY . . WORKDIR "/src/src" FROM restore AS build +ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore FROM base AS final diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile index 5eaebb03..4c01f4ac 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile @@ -27,6 +27,7 @@ COPY . . WORKDIR "/src/src" FROM restore AS build +ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore FROM build AS publish diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile index 073f16b8..dc788222 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile @@ -11,6 +11,7 @@ COPY . . WORKDIR "/src/src" FROM restore AS build +ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore FROM base AS final diff --git a/src/Tests/Dockerfiles/windows-nanoserver.dockerfile b/src/Tests/Dockerfiles/windows-nanoserver.dockerfile index cdbef6f5..0c066408 100644 --- a/src/Tests/Dockerfiles/windows-nanoserver.dockerfile +++ b/src/Tests/Dockerfiles/windows-nanoserver.dockerfile @@ -12,6 +12,8 @@ COPY . . WORKDIR "/src/src" FROM restore AS build +ARG BUILD_CONFIGURATION=Release +ARG TARGET_FRAMEWORK=net8.0 RUN dotnet build "./Tests/Tests.csproj" -c %BUILD_CONFIGURATION% -o /app/build/%TARGET_FRAMEWORK% --no-restore -f %TARGET_FRAMEWORK% FROM build AS publish diff --git a/src/Tests/Dockerfiles/windows-servercore.dockerfile b/src/Tests/Dockerfiles/windows-servercore.dockerfile index ef2df400..6f657b2b 100644 --- a/src/Tests/Dockerfiles/windows-servercore.dockerfile +++ b/src/Tests/Dockerfiles/windows-servercore.dockerfile @@ -12,6 +12,8 @@ COPY . . WORKDIR "/src/src" FROM restore AS build +ARG BUILD_CONFIGURATION=Release +ARG TARGET_FRAMEWORK=net8.0 RUN dotnet build "./Tests/Tests.csproj" -c %BUILD_CONFIGURATION% -o /app/build/%TARGET_FRAMEWORK% --no-restore -f %TARGET_FRAMEWORK% FROM build AS publish From 17e2ac39ba724df348b1d0af10eb2722f3ee5057 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 14:33:41 +0200 Subject: [PATCH 33/42] Update dockerfiles --- .../Dockerfiles/windows-nanoserver-aot.dockerfile | 7 +------ .../Dockerfiles/windows-servercore-aot.dockerfile | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile index 9ed2e0db..783481ad 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile @@ -2,18 +2,13 @@ WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS sdk -# Restore the default Windows shell for correct batch processing. SHELL ["cmd", "/S", "/C"] RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" -RUN (start /w vs_buildtools.exe --quiet --wait --norestart --nocache \ +RUN (start /w vs_buildtools.exe --wait --norestart --nocache \ --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ --add Microsoft.VisualStudio.Workload.VCTools \ --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 \ - --remove Microsoft.VisualStudio.Component.Windows81SDK \ || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ && del /q vs_buildtools.exe diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile index 4c01f4ac..438cd42b 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile @@ -2,18 +2,13 @@ WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS sdk -# Restore the default Windows shell for correct batch processing. SHELL ["cmd", "/S", "/C"] RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" -RUN (start /w vs_buildtools.exe --quiet --wait --norestart --nocache \ +RUN (start /w vs_buildtools.exe --wait --norestart --nocache \ --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ --add Microsoft.VisualStudio.Workload.VCTools \ --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 \ - --remove Microsoft.VisualStudio.Component.Windows81SDK \ || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ && del /q vs_buildtools.exe From 965cae45f8fb7285cb3ee2f857cb7a75ddee9ea7 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 14:45:54 +0200 Subject: [PATCH 34/42] Update dockerfiles --- .../windows-nanoserver-aot.dockerfile | 27 ++++++++++--------- .../Dockerfiles/windows-servercore.dockerfile | 20 ++++++++++++-- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile index 783481ad..9e3de077 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile @@ -1,18 +1,7 @@ FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS sdk -SHELL ["cmd", "/S", "/C"] - -RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" -RUN (start /w vs_buildtools.exe --wait --norestart --nocache \ - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ - --add Microsoft.VisualStudio.Workload.VCTools \ - --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ - || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ - && del /q vs_buildtools.exe - -FROM sdk AS restore +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -25,7 +14,19 @@ FROM restore AS build ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore -FROM build AS publish +FROM build AS vsbuildtools +SHELL ["cmd", "/S", "/C"] + +RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" +RUN (start /w vs_buildtools.exe --wait --norestart --nocache \ + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ + --add Microsoft.VisualStudio.Workload.VCTools \ + --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ + --add Microsoft.VisualStudio.Component.Windows11SDK.22621\ + || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ + && del /q vs_buildtools.exe + +FROM vsbuildtools AS publish ARG BUILD_CONFIGURATION=Release RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile index dc788222..a04c91a6 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile @@ -14,7 +14,23 @@ FROM restore AS build ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore +FROM build AS vsbuildtools +SHELL ["cmd", "/S", "/C"] + +RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" +RUN (start /w vs_buildtools.exe --wait --norestart --nocache \ + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ + --add Microsoft.VisualStudio.Workload.VCTools \ + --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ + --add Microsoft.VisualStudio.Component.Windows11SDK.22621\ + || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ + && del /q vs_buildtools.exe + +FROM vsbuildtools AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore + FROM base AS final WORKDIR /app -COPY --from=build /app/build . -ENTRYPOINT ["dotnet", "PDFtoImage.FrameworkTests.AotConsole.dll"] \ No newline at end of file +COPY --from=publish /app/publish . +ENTRYPOINT ["PDFtoImage.FrameworkTests.AotConsole.exe"] \ No newline at end of file From f5c7e325cd3b3842d2831c41ae217483024dbdba Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 14:51:50 +0200 Subject: [PATCH 35/42] Update dockerfiles --- .../windows-nanoserver-aot.dockerfile | 6 +++- .../windows-servercore-aot.dockerfile | 31 +++++++++++-------- .../Dockerfiles/windows-servercore.dockerfile | 20 ++---------- 3 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile index 9e3de077..34afe383 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-nanoserver-aot.dockerfile @@ -22,7 +22,11 @@ RUN (start /w vs_buildtools.exe --wait --norestart --nocache \ --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ --add Microsoft.VisualStudio.Workload.VCTools \ --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ - --add Microsoft.VisualStudio.Component.Windows11SDK.22621\ + --add Microsoft.VisualStudio.Component.Windows11SDK.22621 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 \ + --remove Microsoft.VisualStudio.Component.Windows81SDK \ || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ && del /q vs_buildtools.exe diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile index 438cd42b..31d071cb 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore-aot.dockerfile @@ -1,18 +1,7 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS sdk -SHELL ["cmd", "/S", "/C"] - -RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" -RUN (start /w vs_buildtools.exe --wait --norestart --nocache \ - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ - --add Microsoft.VisualStudio.Workload.VCTools \ - --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ - || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ - && del /q vs_buildtools.exe - -FROM sdk AS restore +FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS restore ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["src/FrameworkTests/AotConsole/AotConsole.csproj", "src/FrameworkTests/AotConsole/AotConsole.csproj"] @@ -25,7 +14,23 @@ FROM restore AS build ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore -FROM build AS publish +FROM build AS vsbuildtools +SHELL ["cmd", "/S", "/C"] + +RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" +RUN (start /w vs_buildtools.exe --wait --norestart --nocache \ + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ + --add Microsoft.VisualStudio.Workload.VCTools \ + --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ + --add Microsoft.VisualStudio.Component.Windows11SDK.22621 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 \ + --remove Microsoft.VisualStudio.Component.Windows81SDK \ + || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ + && del /q vs_buildtools.exe + +FROM vsbuildtools AS publish ARG BUILD_CONFIGURATION=Release RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore diff --git a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile index a04c91a6..dc788222 100644 --- a/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile +++ b/src/FrameworkTests/AotConsole/Dockerfiles/windows-servercore.dockerfile @@ -14,23 +14,7 @@ FROM restore AS build ARG BUILD_CONFIGURATION=Release RUN dotnet build "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/build --no-restore -FROM build AS vsbuildtools -SHELL ["cmd", "/S", "/C"] - -RUN powershell -c "Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe" -RUN (start /w vs_buildtools.exe --wait --norestart --nocache \ - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \ - --add Microsoft.VisualStudio.Workload.VCTools \ - --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ - --add Microsoft.VisualStudio.Component.Windows11SDK.22621\ - || IF "%ERRORLEVEL%"=="3010" EXIT 0) \ - && del /q vs_buildtools.exe - -FROM vsbuildtools AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./FrameworkTests/AotConsole/AotConsole.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore - FROM base AS final WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["PDFtoImage.FrameworkTests.AotConsole.exe"] \ No newline at end of file +COPY --from=build /app/build . +ENTRYPOINT ["dotnet", "PDFtoImage.FrameworkTests.AotConsole.dll"] \ No newline at end of file From 281a52eff5488581cde9694b77c4a249f7ff21aa Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 14:56:27 +0200 Subject: [PATCH 36/42] Update workflows --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9e0ef5d8..d2534a9a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -260,7 +260,7 @@ jobs: if: runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore.dockerfile" . && docker build -t console -f windows-servercore.dockerfile . && docker run --rm -t console - name: console (windows-servercore-aot) - if: runner.os == 'Windows' && (success() || failure()) + if: false && runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-servercore-aot.dockerfile" . && docker build -t console -f windows-servercore-aot.dockerfile . && docker run --rm -t console - name: console (windows-nanoserver) if: false && runner.os == 'Windows' && (success() || failure()) From f89276c4d9a6dbef79fcec57f1191ea659ed816b Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 15:19:18 +0200 Subject: [PATCH 37/42] Update dockerignore --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index fe1152bd..36a45bc2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,6 +16,7 @@ **/charts **/docker-compose* **/Dockerfile* +**/.dockerfile **/node_modules **/npm-debug.log **/obj From 50512805b21cfa7648b7ac40b06816b9aab29a93 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 15:20:05 +0200 Subject: [PATCH 38/42] Update dockerignore --- .dockerignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 36a45bc2..4a17b601 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,7 +16,7 @@ **/charts **/docker-compose* **/Dockerfile* -**/.dockerfile +**/*.dockerfile **/node_modules **/npm-debug.log **/obj From 5bb9976c4a3db123b0bd5e52faf010b470dceaca Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 15:32:31 +0200 Subject: [PATCH 39/42] Update workflow --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d2534a9a..94db5259 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -276,10 +276,10 @@ jobs: run: docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f src/Tests/Dockerfiles/ubuntu.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - name: unittests (windows-servercore) if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\Tests\Dockerfiles\windows-servercore.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y "src\Tests\Dockerfiles\windows-servercore.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=C:\app\TestResults -t unittests - name: unittests (windows-nanoserver) if: false && runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests + run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=C:\app\TestResults -t unittests - name: Upload test results if: success() || failure() uses: actions/upload-artifact@main From 087cbc1a47733faeb0f8a9744d9bcf89953a27fa Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 16:05:36 +0200 Subject: [PATCH 40/42] Remove unit tests from docker --- .github/workflows/dotnet.yml | 20 -------------- src/Tests/Dockerfiles/ubuntu.dockerfile | 27 ------------------- .../Dockerfiles/windows-nanoserver.dockerfile | 27 ------------------- .../Dockerfiles/windows-servercore.dockerfile | 27 ------------------- 4 files changed, 101 deletions(-) delete mode 100644 src/Tests/Dockerfiles/ubuntu.dockerfile delete mode 100644 src/Tests/Dockerfiles/windows-nanoserver.dockerfile delete mode 100644 src/Tests/Dockerfiles/windows-servercore.dockerfile diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 94db5259..8c7548a6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -268,26 +268,6 @@ jobs: - name: console (windows-nanoserver-aot) if: false && runner.os == 'Windows' && (success() || failure()) run: xcopy /y "src\FrameworkTests\AotConsole\Dockerfiles\windows-nanoserver-aot.dockerfile" . && docker build -t console -f windows-nanoserver-aot.dockerfile . && docker run --rm -t console - - name: docker system prune - if: success() || failure() - run: docker system prune -a -f - - name: unittests (ubuntu) - if: runner.os == 'Linux' && (success() || failure()) - run: docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f src/Tests/Dockerfiles/ubuntu.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=/app/TestResults -t unittests - - name: unittests (windows-servercore) - if: runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\Tests\Dockerfiles\windows-servercore.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-servercore.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=C:\app\TestResults -t unittests - - name: unittests (windows-nanoserver) - if: false && runner.os == 'Windows' && (success() || failure()) - run: xcopy /y "src\Tests\Dockerfiles\windows-nanoserver.dockerfile" . && docker build -t unittests --build-arg TARGET_FRAMEWORK=net8.0 -f windows-nanoserver.dockerfile . && docker run --rm --mount type=bind,source=${{ github.workspace }}/src/Tests,target=C:\app\TestResults -t unittests - - name: Upload test results - if: success() || failure() - uses: actions/upload-artifact@main - with: - name: Test results (${{ matrix.os }}; docker) - path: ./**/*.trx - if-no-files-found: error - retention-days: 1 publish-test-results: name: Publish tests results needs: [test, docker] diff --git a/src/Tests/Dockerfiles/ubuntu.dockerfile b/src/Tests/Dockerfiles/ubuntu.dockerfile deleted file mode 100644 index e6d0196d..00000000 --- a/src/Tests/Dockerfiles/ubuntu.dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base -WORKDIR /app - -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS restore -ARG BUILD_CONFIGURATION=Release -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 -COPY . . -WORKDIR "/src/src" - -FROM restore AS build -ARG BUILD_CONFIGURATION=Release -ARG TARGET_FRAMEWORK=net8.0 -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 -ARG TARGET_FRAMEWORK=net8.0 -RUN dotnet publish "./Tests/Tests.csproj" -c $BUILD_CONFIGURATION -o /app/publish --no-restore -f $TARGET_FRAMEWORK - -FROM base AS final -WORKDIR /app -COPY --from=publish /app . -ENTRYPOINT ["dotnet", "test", "publish/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file diff --git a/src/Tests/Dockerfiles/windows-nanoserver.dockerfile b/src/Tests/Dockerfiles/windows-nanoserver.dockerfile deleted file mode 100644 index 0c066408..00000000 --- a/src/Tests/Dockerfiles/windows-nanoserver.dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 AS base -WORKDIR /app - -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS restore -ARG BUILD_CONFIGURATION=Release -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% -COPY . . -WORKDIR "/src/src" - -FROM restore AS build -ARG BUILD_CONFIGURATION=Release -ARG TARGET_FRAMEWORK=net8.0 -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 -ARG TARGET_FRAMEWORK=net8.0 -RUN dotnet publish "./Tests/Tests.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore -f %TARGET_FRAMEWORK% - -FROM base AS final -WORKDIR /app -COPY --from=publish /app . -ENTRYPOINT ["dotnet", "test", "publish/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file diff --git a/src/Tests/Dockerfiles/windows-servercore.dockerfile b/src/Tests/Dockerfiles/windows-servercore.dockerfile deleted file mode 100644 index 6f657b2b..00000000 --- a/src/Tests/Dockerfiles/windows-servercore.dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS base -WORKDIR /app - -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS restore -ARG BUILD_CONFIGURATION=Release -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% -COPY . . -WORKDIR "/src/src" - -FROM restore AS build -ARG BUILD_CONFIGURATION=Release -ARG TARGET_FRAMEWORK=net8.0 -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 -ARG TARGET_FRAMEWORK=net8.0 -RUN dotnet publish "./Tests/Tests.csproj" -c %BUILD_CONFIGURATION% -o /app/publish --no-restore -f %TARGET_FRAMEWORK% - -FROM base AS final -WORKDIR /app -COPY --from=publish /app . -ENTRYPOINT ["dotnet", "test", "publish/PDFtoImage.Tests.dll", "/logger:console;verbosity=detailed", "/logger:trx;verbosity=detailed"] \ No newline at end of file From f04d1e5493b883add8e06cf4b80712cbf8f0ff0e Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 16:07:49 +0200 Subject: [PATCH 41/42] sparse-checkout for docker --- .github/workflows/dotnet.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 8c7548a6..7d0d7c67 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -244,6 +244,9 @@ jobs: uses: actions/checkout@main with: fetch-depth: 0 + sparse-checkout: | + src/PDFtoImage + src/FrameworkTests/AotConsole - name: console (ubuntu) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile . && docker run --rm -t console From bb3eb555aa7f785915d699c9feed7df2a027565b Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Thu, 4 Jul 2024 16:09:34 +0200 Subject: [PATCH 42/42] Update workflow --- .github/workflows/dotnet.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7d0d7c67..05426bb7 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -247,6 +247,7 @@ jobs: sparse-checkout: | src/PDFtoImage src/FrameworkTests/AotConsole + src/Tests/Assets/SocialPreview.pdf - name: console (ubuntu) if: runner.os == 'Linux' && (success() || failure()) run: docker build -t console -f src/FrameworkTests/AotConsole/Dockerfiles/ubuntu.dockerfile . && docker run --rm -t console