Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions .github/workflows/cts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@ jobs:

- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --target ${{ matrix.target }}
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --target ${{ matrix.target }} --component llvm-tools
rustup override set ${{ env.MSRV }}
cargo -V

- name: Install `cargo-llvm-cov`
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov

- name: caching
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -60,7 +65,7 @@ jobs:
mkdir -p .cargo
cat <<EOF >> .cargo/config.toml
[profile.dev]
debug = 1
debug = "line-tables-only"
EOF

- name: (Windows) Install DXC
Expand All @@ -71,12 +76,28 @@ jobs:
if: matrix.os == 'windows-2022'
uses: ./.github/actions/install-warp
with:
target-dirs: "target/debug"
target-dirs: "target/llvm-cov-target/debug"

- name: (Linux) Install Mesa
if: matrix.os == 'ubuntu-24.04'
uses: ./.github/actions/install-mesa

- name: run CTS
shell: bash
run: cargo xtask cts
run: cargo xtask cts --llvm-cov

- name: Generate coverage report
id: coverage
shell: bash
continue-on-error: true
run: |
set -e

cargo llvm-cov report --lcov --output-path lcov.info

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v5
if: steps.coverage.outcome == 'success'
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
9 changes: 8 additions & 1 deletion xtask/src/cts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const CTS_DEFAULT_TEST_LIST: &str = "cts_runner/test.lst";

pub fn run_cts(shell: Shell, mut args: Arguments) -> anyhow::Result<()> {
let skip_checkout = args.contains("--skip-checkout");
let llvm_cov = args.contains("--llvm-cov");

let mut list_files = Vec::<OsString>::new();
while let Some(file) = args.opt_value_from_str("-f")? {
Expand Down Expand Up @@ -134,12 +135,18 @@ pub fn run_cts(shell: Shell, mut args: Arguments) -> anyhow::Result<()> {
log::info!("Skipping CTS checkout because --skip-checkout was specified");
}

let run_flags = if llvm_cov {
&["llvm-cov", "--no-cfg-coverage", "--no-report", "run"][..]
} else {
&["run"][..]
};

log::info!("Running CTS");
for test in &tests {
log::info!("Running {}", test.to_string_lossy());
shell
.cmd("cargo")
.args(["run"])
.args(run_flags)
.args(["--manifest-path".as_ref(), wgpu_cargo_toml.as_os_str()])
.args(["-p", "cts_runner"])
.args(["--bin", "cts_runner"])
Expand Down