Skip to content

Commit

Permalink
Revert "temporarily disable pipelinesnot being tested"
Browse files Browse the repository at this point in the history
This reverts commit 8dd9baa.
  • Loading branch information
wmmc88 committed Sep 16, 2024
1 parent e2e1bcd commit 706ffdc
Show file tree
Hide file tree
Showing 9 changed files with 550 additions and 4 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
on:
push:
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: "0 11 * * *"

name: Build

env:
RUSTFLAGS: -D warnings

jobs:
build:
name: Build
runs-on: windows-latest
strategy:
matrix:
wdk:
- Microsoft.WindowsWDK.10.0.22621 # NI WDK

llvm:
- 17.0.6

rust_toolchain:
- stable
- beta
- nightly

cargo_profile:
- dev
- release

target_triple:
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Winget
uses: ./.github/actions/winget-install
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install LLVM ${{ matrix.llvm }}
run: |
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '${{ matrix.llvm }}') {
Write-Host "LLVM ${{ matrix.llvm }} is already installed."
} else {
Write-Host "Installing LLVM ${{ matrix.llvm }}..."
Install-WinGetPackage -Id LLVM.LLVM -Version ${{ matrix.llvm }} -Source winget -MatchOption Equals -Mode Silent -Force
}
clang --version
- name: Install WDK (${{ matrix.wdk }})
run: |
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
} else {
Write-Host "Installing ${{ matrix.wdk }}..."
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
}
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
targets: ${{ matrix.target_triple }}

- name: Run Cargo Build
run: cargo +${{ matrix.rust_toolchain }} build --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace

- name: Install Cargo Make
uses: taiki-e/install-action@v2
with:
tool: cargo-make

- name: Run Cargo Make (package-driver-flow) in Workspace
run: cargo make package-driver-flow +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace

- name: Build Examples (via Cargo Make)
run: cargo make --cwd ./examples build +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }}

- name: Package Examples (via Cargo Make)
run: cargo make --cwd ./examples package-driver-flow +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }}
27 changes: 27 additions & 0 deletions .github/workflows/cargo-audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Cargo Audit
on:
push:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: 0 11 * * *

jobs:
cargo_audit:
name: Cargo Audit
runs-on: windows-latest
permissions:
issues: write
checks: write

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Run Cargo Audit
uses: rustsec/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/code-formatting-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Code Formatting Check
on:
push:
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: 0 11 * * *


jobs:
cargo-fmt:
name: .rs Formatting Check
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Rust Toolchain (Nightly)
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt

- name: Run Cargo Format
run: cargo +nightly fmt --all -- --check

taplo-fmt:
name: .toml Formatting Check
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Rust Toolchain (Stable)
uses: dtolnay/rust-toolchain@stable

- name: Install taplo-cli
uses: taiki-e/install-action@v2
with:
tool: taplo-cli

- run: taplo fmt --check --diff
name: Check TOML files formatting
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:

rust_toolchain:
- stable
# - beta
# - nightly
- beta
- nightly

cargo_profile:
- dev
# - release
- release

target_triple:
- x86_64-pc-windows-msvc
# - aarch64-pc-windows-msvc
- aarch64-pc-windows-msvc

include:
- language: c-cpp
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
on:
push:
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: "0 11 * * *"

name: Docs

env:
RUSTDOCFLAGS: -D warnings

jobs:
docs:
name: Docs
runs-on: windows-latest
strategy:
matrix:
wdk:
- Microsoft.WindowsWDK.10.0.22621 # NI WDK

llvm:
- 17.0.6

rust_toolchain:
- stable
- beta
- nightly

cargo_profile:
- dev
- release

target_triple:
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Winget
uses: ./.github/actions/winget-install
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install LLVM ${{ matrix.llvm }}
run: |
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '${{ matrix.llvm }}') {
Write-Host "LLVM ${{ matrix.llvm }} is already installed."
} else {
Write-Host "Installing LLVM ${{ matrix.llvm }}..."
Install-WinGetPackage -Id LLVM.LLVM -Version ${{ matrix.llvm }} -Source winget -MatchOption Equals -Mode Silent -Force
}
clang --version
- name: Install WDK (${{ matrix.wdk }})
run: |
if ((Get-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals).Id -eq '${{ matrix.wdk }}') {
Write-Host "${{ matrix.wdk }} is already installed. Attempting to update..."
Update-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
} else {
Write-Host "Installing ${{ matrix.wdk }}..."
Install-WinGetPackage -Id ${{ matrix.wdk }} -Source winget -MatchOption Equals -Mode Silent -Force
}
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
targets: ${{ matrix.target_triple }}

- name: Run Cargo Doc
# proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-macros

- name: Run Cargo Doc (--features nightly)
if: matrix.rust_toolchain == 'nightly'
# proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-macros --features nightly

- name: Run Cargo Doc w/ proc-macro crates
if: matrix.target_triple == 'x86_64-pc-windows-msvc'
# cargo doc can only generate documentation for proc-macro crates when --target is not specified due to a cargo doc bug: https://github.com/rust-lang/cargo/issues/7677
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }}

- name: Run Cargo Doc w/ proc-macro crates (--features nightly)
if: ${{ matrix.target_triple == 'x86_64-pc-windows-msvc' && matrix.rust_toolchain == 'nightly' }}
# cargo doc can only generate documentation for proc-macro crates when --target is not specified due to a cargo doc bug: https://github.com/rust-lang/cargo/issues/7677
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --features nightly
38 changes: 38 additions & 0 deletions .github/workflows/github-dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Dependency Review
on:
push:
pull_request:
merge_group:

jobs:
dependency-review:
name: Github Dependency Review
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Dependency Review
uses: actions/dependency-review-action@v4
with:
allow-licenses: >-
MIT,
Apache-2.0,
BSD-3-Clause,
ISC,
Unicode-DFS-2016
# [email protected] is licensed as (MIT OR Apache-2.0), but the Github api fails to detect it: https://github.com/rust-cli/anstyle/tree/main/crates/anstyle
# AND combinations are currently bugged (https://github.com/actions/dependency-review-action/issues/263):
# * [email protected] License: Apache-2.0 AND MIT
# * [email protected] License: (MIT OR Apache-2.0) AND Unicode-DFS-2016
allow-dependencies-licenses: 'pkg:cargo/[email protected], pkg:cargo/[email protected], pkg:cargo/[email protected]'
comment-summary-in-pr: on-failure
# Explicit refs required for merge_group and push triggers:
# https://github.com/actions/dependency-review-action/issues/456
# https://github.com/actions/dependency-review-action/issues/252
base-ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || (github.event_name == 'push' && github.event.before || (github.event_name == 'merge_group' && 'main' || 'unsupported trigger' ) ) }}
head-ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || (github.event_name == 'push' && github.sha || (github.event_name == 'merge_group' && github.ref || 'unsupported trigger' ) ) }}
Loading

0 comments on commit 706ffdc

Please sign in to comment.