name: ci on: pull_request: push: branches: - master schedule: - cron: "0 0 * * 1" jobs: clippy: name: Run linter runs-on: ubuntu-latest env: RUSTFLAGS: -D warnings steps: - name: Checkout uses: actions/checkout@v2 - name: Checkout submodules shell: bash run: | auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - uses: hecrj/setup-rust-action@v1 with: components: clippy - run: cargo clippy --workspace --all-targets # excluded crates - run: cargo clippy --manifest-path imgui-examples/Cargo.toml --all-targets - run: cargo clippy --manifest-path imgui-gfx-examples/Cargo.toml --all-targets - run: cargo clippy --manifest-path imgui-sys-bindgen/Cargo.toml --all-targets # supported winit versions - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23 --all-targets rustfmt: name: Check rustfmt runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 # TODO: why not `with: {submodules: true}` - name: Checkout submodules shell: bash run: | auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - uses: hecrj/setup-rust-action@v1 with: components: rustfmt # workspace - run: cargo fmt --all -- --check # excluded crates - run: cargo fmt --manifest-path imgui-examples/Cargo.toml -- --check - run: cargo fmt --manifest-path imgui-gfx-examples/Cargo.toml -- --check - run: cargo fmt --manifest-path imgui-sys-bindgen/Cargo.toml -- --check test: name: Run tests runs-on: ${{ matrix.os }} env: RUSTFLAGS: -D warnings RUST_BACKTRACE: 1 strategy: matrix: rust: - stable - beta - 1.43.0 os: - ubuntu-latest - macos-latest - windows-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Checkout submodules shell: bash run: | auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - name: Install toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.rust }} override: true - run: sudo apt install libxcb-shape0-dev libxcb-xfixes0-dev if: runner.os == 'Linux' - run: cargo test --all - run: cargo test --manifest-path imgui-examples/Cargo.toml - run: cargo test --manifest-path imgui-gfx-examples/Cargo.toml - run: cargo test --manifest-path imgui-sys-bindgen/Cargo.toml - run: cargo test --manifest-path imgui-gfx-examples/Cargo.toml --no-default-features --features directx if: runner.os == 'Windows' - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23