mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Improve CI (#3453)
This commit is contained in:
parent
49cfc88f35
commit
4bebad706e
99
.github/workflows/ci.yml
vendored
99
.github/workflows/ci.yml
vendored
@ -8,8 +8,10 @@ on:
|
|||||||
merge_group:
|
merge_group:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
CARGO_INCREMENTAL: false
|
||||||
RUST_VERSION: 1.64
|
CARGO_TERM_COLOR: always
|
||||||
|
RUST_BACKTRACE: full
|
||||||
|
MSRV: 1.64
|
||||||
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
|
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
|
||||||
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
|
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
|
||||||
RUSTDOCFLAGS: -Dwarnings
|
RUSTDOCFLAGS: -Dwarnings
|
||||||
@ -92,14 +94,10 @@ jobs:
|
|||||||
- name: checkout repo
|
- name: checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: install rust ${{ env.RUST_VERSION }}
|
- name: Install MSRV toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
run: |
|
||||||
with:
|
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
|
||||||
toolchain: ${{ env.RUST_VERSION }}
|
rustup default ${{ env.MSRV }}
|
||||||
target: ${{ matrix.target }}
|
|
||||||
profile: minimal
|
|
||||||
override: true
|
|
||||||
components: clippy
|
|
||||||
|
|
||||||
- name: disable debug
|
- name: disable debug
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -107,7 +105,6 @@ jobs:
|
|||||||
mkdir -p .cargo
|
mkdir -p .cargo
|
||||||
echo """
|
echo """
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
incremental = false
|
|
||||||
debug = false" >> .cargo/config.toml
|
debug = false" >> .cargo/config.toml
|
||||||
|
|
||||||
- name: caching
|
- name: caching
|
||||||
@ -142,8 +139,7 @@ jobs:
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# build for Emscripten/WebGL
|
# build for Emscripten/WebGL
|
||||||
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-hal \
|
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-hal --no-default-features --features webgl,emscripten
|
||||||
--no-default-features --features webgl,emscripten
|
|
||||||
|
|
||||||
# build cube example
|
# build cube example
|
||||||
cargo clippy --target ${{ matrix.target }} --example cube --features webgl,emscripten
|
cargo clippy --target ${{ matrix.target }} --example cube --features webgl,emscripten
|
||||||
@ -164,8 +160,7 @@ jobs:
|
|||||||
# (But watch out for backend-selection features in wgpu-core; some of
|
# (But watch out for backend-selection features in wgpu-core; some of
|
||||||
# those only build on the right platforms.)
|
# those only build on the right platforms.)
|
||||||
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-info -p player --tests --all-features
|
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-info -p player --tests --all-features
|
||||||
cargo clippy --target ${{ matrix.target }} -p wgpu-core --tests \
|
cargo clippy --target ${{ matrix.target }} -p wgpu-core --tests --features="portable_features"
|
||||||
--features="portable_features"
|
|
||||||
|
|
||||||
# build docs
|
# build docs
|
||||||
# (Watch out for backend-selection features in wgpu-core; some of
|
# (Watch out for backend-selection features in wgpu-core; some of
|
||||||
@ -180,19 +175,14 @@ jobs:
|
|||||||
- name: checkout repo
|
- name: checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: install rust stable
|
# TODO: replace with this once there is a release containing this PR:
|
||||||
uses: actions-rs/toolchain@v1
|
# https://github.com/rustwasm/wasm-pack/pull/1185
|
||||||
with:
|
# - name: Install wasm-pack
|
||||||
toolchain: stable
|
# uses: taiki-e/install-action@v2
|
||||||
profile: minimal
|
# with:
|
||||||
override: true
|
# tool: wasm-pack
|
||||||
|
- name: install wasm-pack
|
||||||
- name: install wasm-pack # install from fork until this is merged: https://github.com/rustwasm/wasm-pack/pull/1185
|
run: cargo install --git https://github.com/rustwasm/wasm-pack --rev e1010233b0ce304f42cda59962254bf30ae97c3e wasm-pack
|
||||||
run: |
|
|
||||||
# replace with "install wasm-pack action", which doesn't work for this project because of https://github.com/rustwasm/wasm-pack/issues/1180
|
|
||||||
# - name: install wasm-pack
|
|
||||||
# uses: jetli/wasm-pack-action@v0.4.0
|
|
||||||
cargo install --git https://github.com/haraldreingruber/wasm-pack wasm-pack
|
|
||||||
|
|
||||||
- name: execute tests
|
- name: execute tests
|
||||||
run: |
|
run: |
|
||||||
@ -221,18 +211,10 @@ jobs:
|
|||||||
- name: checkout repo
|
- name: checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: install rust stable
|
- name: Install cargo-nextest and cargo-llvm-cov
|
||||||
uses: actions-rs/toolchain@v1
|
uses: taiki-e/install-action@v2
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
tool: cargo-nextest,cargo-llvm-cov
|
||||||
profile: minimal
|
|
||||||
override: true
|
|
||||||
components: llvm-tools-preview
|
|
||||||
|
|
||||||
- name: latest cargo-nextest
|
|
||||||
uses: taiki-e/install-action@nextest
|
|
||||||
- name: install cargo-llvm-cov
|
|
||||||
uses: taiki-e/install-action@cargo-llvm-cov
|
|
||||||
|
|
||||||
- name: install swiftshader
|
- name: install swiftshader
|
||||||
if: matrix.os == 'ubuntu-22.04'
|
if: matrix.os == 'ubuntu-22.04'
|
||||||
@ -266,7 +248,6 @@ jobs:
|
|||||||
mkdir -p .cargo
|
mkdir -p .cargo
|
||||||
echo """
|
echo """
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
incremental = false
|
|
||||||
debug = 1" >> .cargo/config.toml
|
debug = 1" >> .cargo/config.toml
|
||||||
|
|
||||||
- name: caching
|
- name: caching
|
||||||
@ -279,7 +260,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cargo llvm-cov run --bin wgpu-info --no-report
|
cargo llvm-cov --no-cfg-coverage run --bin wgpu-info --no-report
|
||||||
|
|
||||||
- name: run tests
|
- name: run tests
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -288,7 +269,7 @@ jobs:
|
|||||||
|
|
||||||
for backend in ${{ matrix.backends }}; do
|
for backend in ${{ matrix.backends }}; do
|
||||||
echo "======= NATIVE TESTS $backend ======";
|
echo "======= NATIVE TESTS $backend ======";
|
||||||
WGPU_BACKEND=$backend cargo llvm-cov nextest -p wgpu -p wgpu-types -p wgpu-hal -p wgpu-core -p player --no-fail-fast --no-report
|
WGPU_BACKEND=$backend cargo llvm-cov --no-cfg-coverage nextest -p wgpu -p wgpu-types -p wgpu-hal -p wgpu-core -p player --no-fail-fast --no-report
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: generate coverage report
|
- name: generate coverage report
|
||||||
@ -305,26 +286,18 @@ jobs:
|
|||||||
|
|
||||||
doctest:
|
doctest:
|
||||||
name: Doctest
|
name: Doctest
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: checkout repo
|
- name: checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: install rust stable
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
profile: minimal
|
|
||||||
override: true
|
|
||||||
|
|
||||||
- name: disable debug
|
- name: disable debug
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p .cargo
|
mkdir -p .cargo
|
||||||
echo """
|
echo """
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
incremental = false
|
|
||||||
debug = 1" >> .cargo/config.toml
|
debug = 1" >> .cargo/config.toml
|
||||||
|
|
||||||
- name: caching
|
- name: caching
|
||||||
@ -346,14 +319,6 @@ jobs:
|
|||||||
- name: checkout repo
|
- name: checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: install rust
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
components: rustfmt
|
|
||||||
|
|
||||||
- name: run rustfmt
|
- name: run rustfmt
|
||||||
run: |
|
run: |
|
||||||
cargo fmt -- --check
|
cargo fmt -- --check
|
||||||
@ -365,13 +330,10 @@ jobs:
|
|||||||
- name: checkout repo
|
- name: checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: install rust ${{ env.RUST_VERSION }}
|
- name: Install MSRV toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
run: |
|
||||||
with:
|
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --component clippy
|
||||||
profile: minimal
|
rustup default ${{ env.MSRV }}
|
||||||
toolchain: ${{ env.RUST_VERSION }}
|
|
||||||
override: true
|
|
||||||
components: clippy
|
|
||||||
|
|
||||||
- name: disable debug
|
- name: disable debug
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -379,7 +341,6 @@ jobs:
|
|||||||
mkdir -p .cargo
|
mkdir -p .cargo
|
||||||
echo """
|
echo """
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
incremental = false
|
|
||||||
debug = 1" >> .cargo/config.toml
|
debug = 1" >> .cargo/config.toml
|
||||||
|
|
||||||
- name: caching
|
- name: caching
|
||||||
@ -403,7 +364,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
command: check advisories
|
command: check advisories
|
||||||
arguments: --all-features --workspace
|
arguments: --all-features --workspace
|
||||||
rust-version: ${{ env.RUST_VERSION }}
|
rust-version: ${{ env.MSRV }}
|
||||||
|
|
||||||
cargo-deny-check-rest:
|
cargo-deny-check-rest:
|
||||||
name: "Run `cargo deny check`"
|
name: "Run `cargo deny check`"
|
||||||
@ -417,4 +378,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
command: check bans licenses sources
|
command: check bans licenses sources
|
||||||
arguments: --all-features --workspace
|
arguments: --all-features --workspace
|
||||||
rust-version: ${{ env.RUST_VERSION }}
|
rust-version: ${{ env.MSRV }}
|
||||||
|
|||||||
21
.github/workflows/cts.yml
vendored
21
.github/workflows/cts.yml
vendored
@ -8,8 +8,10 @@ on:
|
|||||||
types: [labeled, opened, synchronize]
|
types: [labeled, opened, synchronize]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
CARGO_INCREMENTAL: false
|
||||||
RUST_VERSION: 1.64
|
CARGO_TERM_COLOR: always
|
||||||
|
RUST_BACKTRACE: full
|
||||||
|
MSRV: 1.64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cts:
|
cts:
|
||||||
@ -37,7 +39,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: checkout repo
|
- name: checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: wgpu
|
path: wgpu
|
||||||
|
|
||||||
@ -47,16 +49,13 @@ jobs:
|
|||||||
cd cts
|
cd cts
|
||||||
git checkout $(cat ../wgpu/cts_runner/revision.txt)
|
git checkout $(cat ../wgpu/cts_runner/revision.txt)
|
||||||
|
|
||||||
- name: install rust ${{ env.RUST_VERSION }}
|
- name: Install MSRV toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
run: |
|
||||||
with:
|
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --target ${{ matrix.target }}
|
||||||
toolchain: ${{ env.RUST_VERSION }}
|
rustup default ${{ env.MSRV }}
|
||||||
target: ${{ matrix.target }}
|
|
||||||
profile: minimal
|
|
||||||
override: true
|
|
||||||
|
|
||||||
- name: caching
|
- name: caching
|
||||||
uses: Swatinem/rust-cache@v1
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
key: cts-a # suffix for cache busting
|
key: cts-a # suffix for cache busting
|
||||||
working-directory: wgpu/cts_runner
|
working-directory: wgpu/cts_runner
|
||||||
|
|||||||
27
.github/workflows/docs.yml
vendored
27
.github/workflows/docs.yml
vendored
@ -5,22 +5,23 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_INCREMENTAL: false
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
RUST_BACKTRACE: full
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the code
|
- name: Checkout the code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install latest nightly
|
- name: Install nightly toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
run: rustup toolchain install nightly --no-self-update --profile=minimal
|
||||||
with:
|
|
||||||
toolchain: nightly
|
|
||||||
override: true
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Add EGL for OpenGL
|
- name: Add EGL for OpenGL
|
||||||
run: |
|
run: |
|
||||||
@ -38,10 +39,10 @@ jobs:
|
|||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
|
|
||||||
- name: Deploy the docs
|
- name: Deploy the docs
|
||||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
||||||
with:
|
with:
|
||||||
ACCESS_TOKEN: ${{ secrets.WEB_DEPLOY }}
|
token: ${{ secrets.WEB_DEPLOY }}
|
||||||
FOLDER: target/doc
|
folder: target/doc
|
||||||
REPOSITORY_NAME: gfx-rs/wgpu-rs.github.io
|
repository-name: gfx-rs/wgpu-rs.github.io
|
||||||
BRANCH: master
|
branch: master
|
||||||
TARGET_FOLDER: doc
|
target-folder: doc
|
||||||
|
|||||||
36
.github/workflows/publish.yml
vendored
36
.github/workflows/publish.yml
vendored
@ -6,6 +6,9 @@ on:
|
|||||||
- gecko
|
- gecko
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
CARGO_INCREMENTAL: false
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
RUST_BACKTRACE: full
|
||||||
RUSTFLAGS: --cfg=web_sys_unstable_apis
|
RUSTFLAGS: --cfg=web_sys_unstable_apis
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -13,15 +16,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the code
|
- name: Checkout the code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install Rust WASM toolchain
|
- name: Install Rust WASM target
|
||||||
uses: actions-rs/toolchain@v1
|
run: rustup target add wasm32-unknown-unknown
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
target: wasm32-unknown-unknown
|
|
||||||
|
|
||||||
- name: Install wasm-bindgen-cli
|
- name: Install wasm-bindgen-cli
|
||||||
run: cargo install wasm-bindgen-cli --version=0.2.83
|
run: cargo install wasm-bindgen-cli --version=0.2.83
|
||||||
@ -37,13 +37,13 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
- name: Deploy WebGPU examples
|
- name: Deploy WebGPU examples
|
||||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
||||||
with:
|
with:
|
||||||
ACCESS_TOKEN: ${{ secrets.WEB_DEPLOY }}
|
token: ${{ secrets.WEB_DEPLOY }}
|
||||||
FOLDER: target/generated-gpu
|
folder: target/generated-gpu
|
||||||
REPOSITORY_NAME: gfx-rs/wgpu-rs.github.io
|
repository-name: gfx-rs/wgpu-rs.github.io
|
||||||
BRANCH: master
|
branch: master
|
||||||
TARGET_FOLDER: examples-gpu/wasm
|
target-folder: examples-gpu/wasm
|
||||||
|
|
||||||
- name: Clean the build
|
- name: Clean the build
|
||||||
run: cargo clean
|
run: cargo clean
|
||||||
@ -59,10 +59,10 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
- name: Deploy WebGL examples
|
- name: Deploy WebGL examples
|
||||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
||||||
with:
|
with:
|
||||||
ACCESS_TOKEN: ${{ secrets.WEB_DEPLOY }}
|
token: ${{ secrets.WEB_DEPLOY }}
|
||||||
FOLDER: target/generated-gl
|
folder: target/generated-gl
|
||||||
REPOSITORY_NAME: gfx-rs/wgpu-rs.github.io
|
repository-name: gfx-rs/wgpu-rs.github.io
|
||||||
BRANCH: master
|
branch: master
|
||||||
TARGET_FOLDER: examples-gl/wasm
|
target-folder: examples-gl/wasm
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user