diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1e78171 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,194 @@ +name: ci +on: + pull_request: + push: + branches: + - master + schedule: + - cron: "0 0 * * 1" + +jobs: + check: + name: Run checks + runs-on: ubuntu-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 stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt, clippy + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: check + - name: Run cargo check (imgui-examples) + uses: actions-rs/cargo@v1 + with: + command: check + args: --manifest-path imgui-examples/Cargo.toml + - name: Run cargo check (imgui-gfx-examples) + uses: actions-rs/cargo@v1 + with: + command: check + args: --manifest-path imgui-gfx-examples/Cargo.toml + - name: Run cargo check (imgui-sys-bindgen) + uses: actions-rs/cargo@v1 + with: + command: check + args: --manifest-path imgui-sys-bindgen/Cargo.toml + - name: Run cargo check (imgui-winit-support with winit-19) + uses: actions-rs/cargo@v1 + with: + command: check + args: --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 + - name: Run cargo check (imgui-winit-support with winit-20) + uses: actions-rs/cargo@v1 + with: + command: check + args: --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + - name: Run cargo fmt (imgui-examples) + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --manifest-path imgui-examples/Cargo.toml -- --check + - name: Run cargo fmt (imgui-gfx-examples) + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --manifest-path imgui-gfx-examples/Cargo.toml -- --check + - name: Run cargo fmt (imgui-sys-bindgen) + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --manifest-path imgui-sys-bindgen/Cargo.toml -- --check + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all + - name: Run cargo clippy (imgui-examples) + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --manifest-path imgui-examples/Cargo.toml + - name: Run cargo clippy (imgui-gfx-examples) + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --manifest-path imgui-gfx-examples/Cargo.toml + - name: Run cargo clippy (imgui-sys-bindgen) + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --manifest-path imgui-sys-bindgen/Cargo.toml + - name: Clean cache + run: | + cargo install --no-default-features --features ci-autoclean cargo-cache + cargo-cache + test: + name: Run tests + needs: [check] + runs-on: ${{ matrix.os }} + strategy: + matrix: + rust: + - stable + - beta + - 1.36.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 + - name: Install Ubuntu packages + run: sudo apt install libxcb-shape0-dev libxcb-xfixes0-dev + if: runner.os == 'Linux' + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --all + - name: Run cargo test (imgui-examples) + uses: actions-rs/cargo@v1 + with: + command: test + args: --manifest-path imgui-examples/Cargo.toml + - name: Run cargo test (imgui-gfx-examples) + uses: actions-rs/cargo@v1 + with: + command: test + args: --manifest-path imgui-gfx-examples/Cargo.toml + - name: Run cargo test (imgui-sys-bindgen) + uses: actions-rs/cargo@v1 + with: + command: test + args: --manifest-path imgui-sys-bindgen/Cargo.toml + - name: Run cargo test (imgui-gfx-examples with directx) + uses: actions-rs/cargo@v1 + if: runner.os == 'Windows' + with: + command: test + args: --manifest-path imgui-gfx-examples/Cargo.toml --no-default-features --features directx + - name: Run cargo test (imgui-winit-support with winit-19) + uses: actions-rs/cargo@v1 + with: + command: test + args: --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 + - name: Run cargo test (imgui-winit-support with winit-20) + uses: actions-rs/cargo@v1 + with: + command: test + args: --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 + - name: Clean cache + run: | + cargo install --no-default-features --features ci-autoclean cargo-cache + cargo-cache diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 787df41..0000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -sudo: false -dist: bionic -language: rust -rust: - - stable - - beta - - nightly - - 1.36.0 -os: - - linux - - osx - - windows -addons: - apt: - packages: - - libxcb-shape0-dev - - libxcb-xfixes0-dev - -cache: - directories: - - /home/travis/.cargo - -before_cache: - - rm -rf /home/travis/.cargo/registry - -matrix: - allow_failures: - - rust: nightly - -before_install: - - git submodule update --init --recursive - -script: - - cargo build --all --verbose - - cargo test --all --verbose - - cargo build --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 - - cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 - - cargo build --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 - - cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 - - cargo build --all --verbose --manifest-path imgui-examples/Cargo.toml - - cargo test --all --verbose --manifest-path imgui-examples/Cargo.toml - - cargo build --all --verbose --manifest-path imgui-gfx-examples/Cargo.toml - - cargo test --all --verbose --manifest-path imgui-gfx-examples/Cargo.toml - - if [ "${TRAVIS_OS_NAME}" = "windows" ]; then cargo build --all --verbose --no-default-features --features directx --manifest-path imgui-gfx-examples/Cargo.toml; fi - - if [ "${TRAVIS_OS_NAME}" = "windows" ]; then cargo test --all --verbose --no-default-features --features directx --manifest-path imgui-gfx-examples/Cargo.toml; fi diff --git a/Cargo.toml b/Cargo.toml index 55dd74a..991010f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,9 +14,6 @@ exclude = [ "/resources" ] -[badges] -travis-ci = { repository = "Gekkio/imgui-rs" } - [dependencies] bitflags = "1.0" glium = { version = "0.25", default-features = false, optional = true } diff --git a/README.markdown b/README.markdown index bdaf4ce..f7b39e6 100644 --- a/README.markdown +++ b/README.markdown @@ -6,7 +6,7 @@ Minimum Rust version: 1.36 Wrapped Dear ImGui version: 1.73 -[![Build Status](https://travis-ci.org/Gekkio/imgui-rs.svg?branch=master)](https://travis-ci.org/Gekkio/imgui-rs) +[![Build Status](https://github.com/Gekkio/imgui-rs/workflows/ci/badge.svg)](https://github.com/Gekkio/imgui-rs/actions) [![Latest release on crates.io](https://meritbadge.herokuapp.com/imgui)](https://crates.io/crates/imgui) [![Documentation on docs.rs](https://docs.rs/imgui/badge.svg)](https://docs.rs/imgui) diff --git a/imgui-gfx-renderer/Cargo.toml b/imgui-gfx-renderer/Cargo.toml index 452c12b..848a223 100644 --- a/imgui-gfx-renderer/Cargo.toml +++ b/imgui-gfx-renderer/Cargo.toml @@ -14,9 +14,6 @@ opengl = [] directx = [] default = ["opengl"] -[badges] -travis-ci = { repository = "Gekkio/imgui-rs" } - [dependencies] gfx = "0.18" imgui = { version = "0.3.0-pre", path = "../", features = ["gfx"] } diff --git a/imgui-glium-renderer/Cargo.toml b/imgui-glium-renderer/Cargo.toml index 96235ea..02ee484 100644 --- a/imgui-glium-renderer/Cargo.toml +++ b/imgui-glium-renderer/Cargo.toml @@ -9,9 +9,6 @@ repository = "https://github.com/Gekkio/imgui-rs" license = "MIT/Apache-2.0" categories = ["gui", "rendering"] -[badges] -travis-ci = { repository = "Gekkio/imgui-rs" } - [dependencies] glium = { version = "0.25", default-features = false } imgui = { version = "0.3.0-pre", path = "../", features = ["glium"] } diff --git a/imgui-sys/Cargo.toml b/imgui-sys/Cargo.toml index 9e9d59f..1c4e344 100644 --- a/imgui-sys/Cargo.toml +++ b/imgui-sys/Cargo.toml @@ -10,8 +10,5 @@ license = "MIT/Apache-2.0" categories = ["gui", "external-ffi-bindings"] build = "build.rs" -[badges] -travis-ci = { repository = "Gekkio/imgui-rs" } - [build-dependencies] cc = "1.0" diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index 3b4a001..2af6f5a 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -9,9 +9,6 @@ repository = "https://github.com/Gekkio/imgui-rs" license = "MIT/Apache-2.0" categories = ["gui"] -[badges] -travis-ci = { repository = "Gekkio/imgui-rs" } - [dependencies] imgui = { version = "0.3.0-pre", path = "../" } winit-19 = { version = ">= 0.16, <= 0.19", package = "winit", optional = true }