Bump actions/upload-artifact from 5 to 6 in /.github/workflows #234
Workflow file for this run
This file contains hidden or 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
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| rust: | |
| name: Lint Rust code | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Cargo fmt | |
| run: cargo fmt --all -- --check | |
| - name: Cargo clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| - name: Cargo test | |
| run: cargo test --workspace | |
| - name: Install nightly Rust | |
| uses: dtolnay/rust-toolchain@nightly | |
| # Test minimal versions to ensure our version specifiers in Cargo.toml | |
| # define a correct lower-bound, including all version ranges for the | |
| # windows crate. | |
| - name: Generate lockfile with minimal dependency versions | |
| run: cargo +nightly generate-lockfile -Zminimal-versions | |
| - name: Cargo clippy with minimal-versions | |
| # Exclude api_gen because it does not need to build on minimum versions. | |
| # (there's breakage in serde_json 1.0.45 used by windows-bindgen) | |
| run: cargo +stable clippy --workspace --exclude api_gen --all-targets -- -D warnings | |
| generate-winmd: | |
| name: Generate winmd | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Clean | |
| run: Remove-Item -Recurse -Force .windows/winmd/ | |
| - name: Configure environment | |
| shell: pwsh | |
| run: | | |
| "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64" >> $env:GITHUB_PATH | |
| ((Resolve-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64") | |
| | Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH | |
| - name: Generate | |
| run: dotnet build .metadata | |
| - name: Upload | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: metadata | |
| path: .windows/winmd | |
| generate-rust: | |
| name: Generate Rust crate | |
| runs-on: ubuntu-latest | |
| needs: generate-winmd | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Clean | |
| run: rm -rf .windows/winmd/ src/Amd/ | |
| - name: Download | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: metadata | |
| path: .windows/winmd | |
| - name: Generate | |
| run: cargo r -p api_gen | |
| - name: Upload crate source | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: crate-source | |
| path: src/ | |
| - name: Diff generated Rust code | |
| run: test -z "$(git status --porcelain -- ':!.windows')" || (echo "::error::Generated files are different, please regenerate with cargo run -p api_gen!"; git status; false) |