From 58859370de251f3e152b188954089ed87b1f6f59 Mon Sep 17 00:00:00 2001 From: Sahara Yousuf Date: Thu, 14 Mar 2024 11:16:09 -0500 Subject: [PATCH] Refactor GitHub Actions workflow file - Let's make the workflow a bit more readable. - Let's make sure we run the new AddQRCode sample in CI. --- .github/workflows/test-dotnet-samples.yml | 28 +++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-dotnet-samples.yml b/.github/workflows/test-dotnet-samples.yml index 8d8344b..6fa46ba 100644 --- a/.github/workflows/test-dotnet-samples.yml +++ b/.github/workflows/test-dotnet-samples.yml @@ -42,6 +42,7 @@ jobs: 'ContentCreation/WriteNChannelTiff/', 'ContentModification/Action/', 'ContentModification/AddCollection/', + 'ContentModification/AddQRCode/', 'ContentModification/ChangeLayerConfiguration/', 'ContentModification/ChangeLinkColors/', 'ContentModification/CreateLayer/', @@ -101,38 +102,38 @@ jobs: 'Text/RegexTextSearch/', 'Text/TextExtract/' ] + steps: - name: Checkout uses: actions/checkout@v4 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Setup Microsoft Core Fonts working-directory: ${{ matrix.dir }} run: | sample_name=$(basename "$PWD") - if [ "${{ matrix.os }}" == 'ubuntu-latest' ]; then case "$sample_name" in "AddHeaderFooter" | "AddElements" | "MakeDocWithCalGrayColorSpace" | "MakeDocWithCalRGBColorSpace" | "MakeDocWithDeviceNColorSpace" | "MakeDocWithICCBasedColorSpace" | "MakeDocWithIndexedColorSpace" | "MakeDocWithLabColorSpace" | "MakeDocWithSeparationColorSpace" | "ExtendedGraphicStates" | "AddGlyphs" | "AddUnicodeText") - echo 'ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true' | sudo debconf-set-selections - sudo apt-get install ttf-mscorefonts-installer - ;; + echo 'ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true' | sudo debconf-set-selections + sudo apt-get install ttf-mscorefonts-installer + ;; esac fi + - name: Build samples working-directory: ${{ matrix.dir }} run: | sample_name=$(basename "$PWD") - if { [ "$sample_name" != "ConvertToOffice" ] && [ "$sample_name" != "CreateDocFromXPS" ]; } || [ "${{ matrix.os }}" != 'macos-14' ]; then dotnet build -c Release *.csproj else echo "Not available on this os" fi - - name: List files - run: | - ls ${{matrix.dir}} + - name: Run samples working-directory: ${{matrix.dir}} run: | @@ -159,13 +160,12 @@ jobs: echo "Not available on this os" fi fi + - name: Set sample_name variable id: set-sample-name working-directory: ${{matrix.dir}} - run: | - sample_name=$(basename "$PWD") - echo "SAMPLE_NAME=$sample_name" >> "$GITHUB_ENV" - echo "Set $sample_name as SAMPLE_NAME environment variable" + run: echo "SAMPLE_NAME=$(basename "$PWD")" >> "$GITHUB_ENV" + - name: Save artifacts uses: actions/upload-artifact@v4 with: @@ -185,3 +185,7 @@ jobs: ${{matrix.dir}}*.json ${{matrix.dir}}*.txt ${{matrix.dir}}*.csv + + - name: List files + run: | + ls ${{matrix.dir}}