diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e5cac97..2ea4d21 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,18 +14,31 @@ env: NDI_SDK_DIR: C:\Program Files\NDI\NDI 6 SDK jobs: - setup: - uses: ./.github/workflows/setup-environment.yml - with: - sdk_url: ${{ secrets.NDI_SDK_ZIP_URL }} - test: name: Test - needs: setup runs-on: windows-latest steps: - uses: actions/checkout@v4 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + + - name: Install LLVM for bindgen (Windows) + run: choco install llvm + + - name: Download NDI SDK Library Installer (Windows) + run: curl -L -o NDI_6_SDK.zip ${{ secrets.NDI_SDK_ZIP_URL }} + + - name: Install NDI SDK Library (Windows) + run: Expand-Archive -Path '.\NDI_6_SDK.zip' -DestinationPath $env:NDI_SDK_DIR + + - name: Set Environment Variables (Windows) + run: | + echo "%NDI_SDK_DIR%\Bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + shell: pwsh + - uses: Swatinem/rust-cache@v2 - name: Run tests @@ -35,7 +48,6 @@ jobs: format: name: Format - needs: setup runs-on: windows-latest steps: - uses: actions/checkout@v4 @@ -45,12 +57,25 @@ jobs: with: components: rustfmt + - name: Install LLVM for bindgen (Windows) + run: choco install llvm + + - name: Download NDI SDK Library Installer (Windows) + run: curl -L -o NDI_6_SDK.zip ${{ secrets.NDI_SDK_ZIP_URL }} + + - name: Install NDI SDK Library (Windows) + run: Expand-Archive -Path '.\NDI_6_SDK.zip' -DestinationPath $env:NDI_SDK_DIR + + - name: Set Environment Variables (Windows) + run: | + echo "%NDI_SDK_DIR%\Bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + shell: pwsh + - name: Check formatting run: cargo fmt --all -- --check lint: name: Lint - needs: setup runs-on: windows-latest steps: - uses: actions/checkout@v4 @@ -60,6 +85,20 @@ jobs: with: components: clippy + - name: Install LLVM for bindgen (Windows) + run: choco install llvm + + - name: Download NDI SDK Library Installer (Windows) + run: curl -L -o NDI_6_SDK.zip ${{ secrets.NDI_SDK_ZIP_URL }} + + - name: Install NDI SDK Library (Windows) + run: Expand-Archive -Path '.\NDI_6_SDK.zip' -DestinationPath $env:NDI_SDK_DIR + + - name: Set Environment Variables (Windows) + run: | + echo "%NDI_SDK_DIR%\Bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + shell: pwsh + - name: Run Clippy run: cargo clippy -- -D warnings @@ -74,6 +113,20 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable + - name: Install LLVM for bindgen (Windows) + run: choco install llvm + + - name: Download NDI SDK Library Installer (Windows) + run: curl -L -o NDI_6_SDK.zip ${{ secrets.NDI_SDK_ZIP_URL }} + + - name: Install NDI SDK Library (Windows) + run: Expand-Archive -Path '.\NDI_6_SDK.zip' -DestinationPath $env:NDI_SDK_DIR + + - name: Set Environment Variables (Windows) + run: | + echo "%NDI_SDK_DIR%\Bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + shell: pwsh + - uses: Swatinem/rust-cache@v2 - name: Publish to crates.io diff --git a/.github/workflows/setup-environment.yml b/.github/workflows/setup-environment.yml deleted file mode 100644 index 863d179..0000000 --- a/.github/workflows/setup-environment.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Setup Environment - -on: - workflow_call: - inputs: - sdk_url: - description: "The URL to download the NDI SDK" - required: true - type: string - outputs: - sdk_path: - description: "The path to the NDI SDK" - value: ${{ jobs.setup.outputs.sdk_path }} - -jobs: - setup: - runs-on: windows-latest - outputs: - sdk_path: ${{ steps.set-sdk-path.outputs.sdk_path }} - steps: - - uses: actions/checkout@v4 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - - - name: Install LLVM for bindgen (Windows) - run: choco install llvm - - - name: Download NDI SDK Library Installer (Windows) - run: curl -L -o NDI_6_SDK.zip ${{ inputs.sdk_url }} - - - name: Install NDI SDK Library (Windows) - id: install-sdk - run: Expand-Archive -Path '.\NDI_6_SDK.zip' -DestinationPath $env:NDI_SDK_DIR - - - name: Set Environment Variables (Windows) - id: set-sdk-path - run: | - echo "%NDI_SDK_DIR%\Bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - shell: pwsh