Skip to content

Commit 1de5440

Browse files
committed
CI: Test Rust example
1 parent 5a672ea commit 1de5440

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/MediaInfoLib_Checks.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ jobs:
131131
with:
132132
repository: MediaArea/ZenLib
133133
path: ZenLib
134+
- name: Checkout MediaArea-Utils-Binaries for 7-Zip and NSIS
135+
uses: actions/checkout@v5
136+
with:
137+
repository: MediaArea/MediaArea-Utils-Binaries
138+
path: MediaArea-Utils-Binaries
139+
sparse-checkout: |
140+
Windows/7-Zip
141+
Windows/NSIS
134142
- name: Checkout MediaInfoLib
135143
uses: actions/checkout@v5
136144
with:
@@ -141,3 +149,60 @@ jobs:
141149
msbuild-architecture: x64
142150
- name: Build
143151
run: msbuild -p:Configuration=Release -p:Platform=${{ matrix.architecture }} ${{ github.workspace }}\MediaInfoLib\Project\MSVC2022\MediaInfoLib.sln -verbosity:quiet -warnaserror
152+
- name: Prepare package script
153+
run: (Get-Content ${{ github.workspace }}\MediaInfoLib\Release\Release_DLL_Windows_ARM64.bat) -replace 'ARM64EC', 'ARM64' | Set-Content ${{ github.workspace }}\MediaInfoLib\Release\Release_DLL_Windows_ARM64.bat
154+
- name: Package
155+
if: ${{ matrix.architecture != 'Win32' }}
156+
run: |
157+
cd ${{ github.workspace }}\MediaInfoLib\Release
158+
.\Release_DLL_Windows_${{ matrix.architecture }}.bat
159+
- name: Upload artifact
160+
if: ${{ matrix.architecture != 'Win32' }}
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name: ${{ matrix.architecture }}
164+
path: ${{ github.workspace }}\MediaInfoLib\Release\MediaInfo_DLL_Windows_${{ matrix.architecture }}_WithoutInstaller.7z
165+
166+
Rust:
167+
needs: MSBuild
168+
strategy:
169+
matrix:
170+
include:
171+
- os: windows-latest
172+
architecture: x64
173+
- os: windows-11-arm
174+
architecture: ARM64
175+
- os: ubuntu-latest
176+
architecture: AMD64
177+
fail-fast: false
178+
runs-on: ${{ matrix.os }}
179+
env:
180+
CARGO_TERM_COLOR: always
181+
steps:
182+
- name: Checkout MediaInfoLib
183+
if: ${{ runner.os != 'Windows' }}
184+
uses: actions/checkout@v5
185+
- name: Install libmediainfo-dev
186+
if: ${{ runner.os != 'Windows' }}
187+
run: sudo apt-get install -y libmediainfo-dev
188+
- name: Download artifact
189+
if: ${{ runner.os == 'Windows' }}
190+
uses: actions/download-artifact@v5
191+
with:
192+
name: ${{ matrix.architecture }}
193+
- name: Delete artifact
194+
if: ${{ runner.os == 'Windows' }}
195+
uses: geekyeggo/delete-artifact@v5
196+
with:
197+
name: ${{ matrix.architecture }}
198+
- name: Extract package
199+
if: ${{ runner.os == 'Windows' }}
200+
run: 7z x MediaInfo_DLL_Windows_${{ matrix.architecture }}_WithoutInstaller.7z
201+
- name: Build
202+
run: |
203+
cd ${{ runner.os == 'Windows' && 'Developers\Source\Example\HowToUse_Dll-rs' || 'Source/Example/HowToUse_Dll-rs' }}
204+
cargo build --release
205+
- name: Test run
206+
run: |
207+
cd ${{ runner.os == 'Windows' && 'Developers\Source\Example\HowToUse_Dll-rs' || 'Source/Example/HowToUse_Dll-rs' }}
208+
cargo run --release ${{ runner.os != 'Windows' && '-- ../../../Release/Example.ogg' || '' }}

0 commit comments

Comments
 (0)