fmt #266
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: CI | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
env: | |
RUST_BACKTRACE: 1 | |
CARGO_INCREMENTAL: 0 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
steps: | |
- uses: actions/checkout@v2 | |
- name: build | |
if: ${{ !cancelled() }} | |
run: cargo build --workspace --features serde --all-targets -v | |
- name: test | |
if: ${{ !cancelled() }} | |
run: cargo test --workspace --no-default-features --features serde --all-targets -v | |
miri: | |
runs-on: ubuntu-latest | |
env: | |
RUST_BACKTRACE: 1 | |
CARGO_INCREMENTAL: 0 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
components: miri | |
- name: miri test | |
run: cargo +nightly miri test --no-default-features --features serde -v -- --format=terse | |
wasm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install wasm-pack | |
run: cargo install wasm-pack -vv | |
- name: wasm test | |
run: wasm-pack test --headless --firefox -- --no-default-features -vv | |
env: | |
RUSTFLAGS: --cfg run_in_browser | |
krnlc: | |
runs-on: ${{ matrix.os }} | |
env: | |
RUST_BACKTRACE: 1 | |
CARGO_INCREMENTAL: 0 | |
# spirv tools install copied from https://github.com/EmbarkStudios/rust-gpu/blob/main/.github/workflows/ci.yaml | |
spirv_tools_version: "20221024" | |
# NOTE(eddyb) do not forget to update both the above date and below links! | |
# FIXME(eddyb) automate this somewhat by taking advantage of the bucket APIs, | |
# and look for the first build with the date in `spirv_tools_version`. | |
spirv_tools_linux_url: "https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-clang-release/continuous/1863/20221024-094528/install.tgz" | |
spirv_tools_macos_url: "https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/macos-clang-release/continuous/1875/20221024-094531/install.tgz" | |
spirv_tools_windows_url: "https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/windows-msvc-2017-release/continuous/1851/20221024-094908/install.zip" | |
RUSTUP_UNPACK_RAM: "26214400" | |
RUSTUP_IO_THREADS: "1" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
# spirv tools install copied from https://github.com/EmbarkStudios/rust-gpu/blob/main/.github/workflows/ci.yaml | |
steps: | |
- uses: actions/checkout@v2 | |
- if: ${{ runner.os == 'Linux' }} | |
name: Linux - Install native dependencies and spirv-tools | |
run: | | |
sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev | |
mkdir "${HOME}/spirv-tools" | |
curl -fL "$spirv_tools_linux_url" | tar -xz -C "${HOME}/spirv-tools" | |
echo "${HOME}/spirv-tools/install/bin" >> $GITHUB_PATH | |
- if: ${{ runner.os == 'macOS' }} | |
name: Mac - Install spirv-tools | |
# FIXME(eddyb) deduplicate with Linux (and maybe even Windows?). | |
run: | | |
mkdir "${HOME}/spirv-tools" | |
curl -fL "$spirv_tools_macos_url" | tar -xz -C "${HOME}/spirv-tools" | |
echo "${HOME}/spirv-tools/install/bin" >> $GITHUB_PATH | |
- if: ${{ runner.os == 'Windows' }} | |
name: Windows - Install spirv-tools | |
shell: bash | |
run: | | |
tmparch=$(mktemp) | |
mkdir "${HOME}/spirv-tools" | |
curl -fL -o "$tmparch" "$spirv_tools_windows_url" | |
unzip "$tmparch" -d "${HOME}/spirv-tools" | |
- if: ${{ runner.os == 'Windows' }} | |
# Runs separately to add spir-v tools to Powershell's Path. | |
run: echo "$HOME/spirv-tools/install/bin" >> $env:GITHUB_PATH | |
# end install spirv-tools | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2023-05-27 | |
components: rust-src, rustc-dev, llvm-tools-preview | |
- name: check krnlc | |
if: ${{ !cancelled() }} | |
run: cargo +nightly-2023-05-27 -Zunstable-options -C=krnlc check --locked --no-default-features --features use-installed-tools -vv | |
- name: install krnlc | |
if: ${{ !cancelled() }} | |
run: cargo +nightly-2023-05-27 install --path krnlc --root . --locked --no-default-features --features use-installed-tools -vv --debug | |
- name: krnlc check | |
if: ${{ !cancelled() }} | |
run: ./bin/krnlc --check -p krnl -p krnlc-tests -p compute-benchmarks -v | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
RUST_BACKTRACE: 1 | |
CARGO_INCREMENTAL: 0 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2023-05-27 | |
components: rustfmt, clippy, rust-src, rustc-dev, llvm-tools-preview | |
- name: fmt | |
run: cargo fmt --check | |
- name: clippy | |
if: ${{ !cancelled() }} | |
run: cargo clippy -- -D warnings | |
- name: krnlc fmt | |
if: ${{ !cancelled() }} | |
run: cargo +nightly-2023-05-27 fmt --check --manifest-path krnlc/Cargo.toml | |
- name: krnlc clippy | |
if: ${{ !cancelled() }} | |
run: cargo +nightly-2023-05-27 clippy --manifest-path krnlc/Cargo.toml --no-default-features --features use-installed-tools -v -- -D warnings | |
- name: rustdoc | |
if: ${{ !cancelled() }} | |
run: cargo rustdoc --all-features -- --D warnings | |
cargo-deny: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
manifest-path: "krnlc/Cargo.toml" |