Skip to content

Commit

Permalink
Run macOS CI first
Browse files Browse the repository at this point in the history
  • Loading branch information
datalogics-saharay committed Apr 18, 2024
1 parent 0981e19 commit 5df90a5
Showing 1 changed file with 53 additions and 51 deletions.
104 changes: 53 additions & 51 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,12 @@ jobs:
- name: Print message
run: echo "Set MATRIX_DIR environment variable as output"

run-samples-windows:
runs-on: windows-latest
run-samples-macos:
runs-on: macos-14
needs: [get-matrix-dir-from-env]
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
dir: ${{ fromJSON(needs.get-matrix-dir-from-env.outputs.MATRIX_DIR) }}
dir: ${{ fromJSON(needs.get-matrix-dir-from-env.outputs.MATRIX_DIR) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -129,18 +125,26 @@ jobs:
- name: Build samples
working-directory: ${{ matrix.dir }}
run: |
dotnet build -c Release *.csproj
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: Run samples
working-directory: ${{ matrix.dir }}
run: |
sample_name=$(basename "$PWD")
if [[ "$sample_name" == "DocToImages" ]]; then
bin/Release/net6.0/$sample_name.exe -format=png $HOME/.nuget/packages/adobe.pdf.library.sampleinput/1.0.0/build/Resources/Sample_Input/ducky.pdf
else
bin/Release/net6.0/$sample_name.exe
fi
if [[ ("$sample_name" != "ConvertToOffice" && "$sample_name" != "CreateDocFromXPS") || "${{ matrix.os }}" != 'macos-14' ]]; then
if [[ "$sample_name" == "DocToImages" ]]; then
dotnet bin/Release/net6.0/$sample_name.dll -format=png $HOME/.nuget/packages/adobe.pdf.library.sampleinput/1.0.0/build/Resources/Sample_Input/ducky.pdf
else
dotnet bin/Release/net6.0/$sample_name.dll
fi
else
echo "Not available on this os"
fi
- name: Set sample_name variable
working-directory: ${{ matrix.dir }}
Expand Down Expand Up @@ -170,13 +174,17 @@ jobs:
- name: List files
run: ls ${{ matrix.dir }}

run-samples-ubuntu:
runs-on: ubuntu-latest

run-samples-windows:
runs-on: windows-latest
needs: [get-matrix-dir-from-env, run-samples-macos]
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
dir: ${{ fromJSON(vars.MATRIX_DIR) }}
needs: [run-samples-windows]
dir: ${{ fromJSON(needs.get-matrix-dir-from-env.outputs.MATRIX_DIR) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -186,16 +194,6 @@ jobs:
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Setup Microsoft Core Fonts
run: |
sample_name=$(basename "$PWD")
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 -y ttf-mscorefonts-installer
;;
esac
- name: Build samples
working-directory: ${{ matrix.dir }}
run: |
Expand All @@ -205,16 +203,15 @@ jobs:
working-directory: ${{ matrix.dir }}
run: |
sample_name=$(basename "$PWD")
if [[ "$sample_name" == "Redactions" && "${{ matrix.os }}" == 'ubuntu-latest' ]]; then
echo "Not available on this os"
if [[ "$sample_name" == "DocToImages" ]]; then
bin/Release/net6.0/$sample_name.exe -format=png $HOME/.nuget/packages/adobe.pdf.library.sampleinput/1.0.0/build/Resources/Sample_Input/ducky.pdf
else
if [[ "$sample_name" == "DocToImages" ]]; then
dotnet bin/Release/net6.0/$sample_name.dll -format=png $HOME/.nuget/packages/adobe.pdf.library.sampleinput/1.0.0/build/Resources/Sample_Input/ducky.pdf
else
dotnet bin/Release/net6.0/$sample_name.dll
fi
bin/Release/net6.0/$sample_name.exe
fi
- name: Set sample_name variable
working-directory: ${{ matrix.dir }}
id: set-sample-name
run: echo "SAMPLE_NAME=$(basename "$PWD")" >> "$GITHUB_ENV"

Expand All @@ -241,12 +238,13 @@ jobs:
- name: List files
run: ls ${{ matrix.dir }}

run-samples-macos:
runs-on: macos-14
run-samples-ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dir: ${{ fromJSON(vars.MATRIX_DIR) }}
needs: [run-samples-ubuntu]
needs: [run-samples-windows]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -256,28 +254,32 @@ jobs:
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Setup Microsoft Core Fonts
run: |
sample_name=$(basename "$PWD")
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 -y ttf-mscorefonts-installer
;;
esac
- 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
dotnet build -c Release *.csproj
- name: Run samples
working-directory: ${{ matrix.dir }}
run: |
sample_name=$(basename "$PWD")
if [[ ("$sample_name" != "ConvertToOffice" && "$sample_name" != "CreateDocFromXPS") || "${{ matrix.os }}" != 'macos-14' ]]; then
if [[ "$sample_name" == "DocToImages" ]]; then
dotnet bin/Release/net6.0/$sample_name.dll -format=png $HOME/.nuget/packages/adobe.pdf.library.sampleinput/1.0.0/build/Resources/Sample_Input/ducky.pdf
else
dotnet bin/Release/net6.0/$sample_name.dll
fi
if [[ "$sample_name" == "Redactions" && "${{ matrix.os }}" == 'ubuntu-latest' ]]; then
echo "Not available on this os"
else
if [[ "$sample_name" == "DocToImages" ]]; then
dotnet bin/Release/net6.0/$sample_name.dll -format=png $HOME/.nuget/packages/adobe.pdf.library.sampleinput/1.0.0/build/Resources/Sample_Input/ducky.pdf
else
echo "Not available on this os"
dotnet bin/Release/net6.0/$sample_name.dll
fi
- name: Set sample_name variable
Expand Down

0 comments on commit 5df90a5

Please sign in to comment.