From b2bd88b907628bcb89e2c00edaefe42ce2419e66 Mon Sep 17 00:00:00 2001 From: David Sungaila Date: Tue, 2 Jul 2024 21:08:09 +0200 Subject: [PATCH] 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