Deallocate memory #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust CI/CD | |
on: | |
push: | |
branches: ["main"] | |
tags: ["*"] | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-D warnings" | |
NDI_SDK_DIR: C:\Program Files\NDI\NDI 6 SDK | |
jobs: | |
test: | |
name: Test | |
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 | |
run: cargo test --verbose | |
env: | |
TMPDIR: ${{ runner.temp }} | |
format: | |
name: Format | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
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 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
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 | |
publish: | |
name: Publish | |
needs: [test, format, lint] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 | |
run: cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }} |