diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..435f365 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,141 @@ +name: Continuous Integration + +on: + push: + branches: + - master + pull_request: + +jobs: + smithay-ci: + strategy: + fail-fast: false + matrix: + rust: + - stable + features: + - '' + - backend_winit + - backend_drm + - backend_drm_legacy + - backend_drm_gbm + - backend_drm_egl + - backend_libinput + - backend_udev + - backend_session + - backend_session_logind + - renderer_gl + - renderer_glium + - wayland_frontend + - xwayland + - default + - all + + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Cargo cache + uses: actions/cache@v1 + with: + path: ~/.cargo + key: cargo-${{ matrix.rust }} + + - name: Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + + - name: System dependencies + run: sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev + + - name: Test features + if: matrix.features != 'all' + uses: actions-rs/cargo@v1 + with: + command: test + args: --features "${{ matrix.features }}" + + - name: Test all + if: matrix.features == 'all' + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features + + anvil-ci: + strategy: + fail-fast: false + matrix: + rust: + - stable + features: + - '' + - egl + - winit + - udev + - logind + - default + - all + + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Cargo cache + uses: actions/cache@v1 + with: + path: ~/.cargo + key: cargo-${{ matrix.rust }} + + - name: Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + + - name: System dependencies + run: sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev + + - name: Test features + if: matrix.features != 'all' + working-directory: ./anvil + run: cargo test --features "${{ matrix.features }}" + + - name: Test all + if: matrix.features == 'all' + working-directory: ./anvil + run: cargo test --all-features + + + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt, clippy + + - name: System dependencies + run: sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev + + - name: Cargo fmt + run: cargo fmt --all -- --check + + - name: Clippy Smithay + run: cargo clippy --all-features -- -D warnings + + - name: Clippy Anvil + working-directory: ./anvil + run: cargo clippy --all-features -- -D warnings diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..775e946 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,42 @@ +name: Deploy Docs to GitHub Pages + +on: + push: + branches: + - master + +jobs: + doc: + name: Documentation on Github Pages + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Cargo cache + uses: actions/cache@v1 + with: + path: ~/.cargo + key: cargo-stable + + - name: Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Build Documentation + uses: actions-rs/cargo@v1 + with: + command: doc + args: --no-deps --all-features + + - name: Setup index + run: cp ./doc_index.html ./target/doc/ + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./target/doc \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f1e125e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,150 +0,0 @@ -language: rust - -# We need this for the matrix, install is quick although unused -rust: - - stable - -sudo: required - -branches: - only: - - master - -dist: bionic - -# We cannot cache .vagga, because we actually do not have read permissions -# without sudo and travis cache script runs not as sudo... -cache: - directories: - - .vagga/stable-home - - .vagga/beta-home - - .vagga/nightly-home - - .vagga/.cache - -addons: - apt: - packages: - - libcurl4-openssl-dev - - libelf-dev - - libdw-dev - -env: - matrix: - - FEATURES="" - # test individual features - - FEATURES="backend_winit" - - FEATURES="backend_drm" - - FEATURES="backend_drm_legacy" - - FEATURES="backend_drm_gbm" - - FEATURES="backend_drm_egl" - - FEATURES="backend_egl" - - FEATURES="backend_libinput" - - FEATURES="backend_udev" - - FEATURES="backend_session" - - FEATURES="backend_session_logind" - - FEATURES="renderer_gl" - - FEATURES="renderer_glium" - - FEATURES="wayland_frontend" - - FEATURES="xwayland" - # test default features - - FEATURES="default" - # test all features simultaneously - - FEATURES="all" - # test our examples - - FEATURES="examples" - # test our house compositor - - FEATURES="anvil" ANVIL_FEATURES="" - - FEATURES="anvil" ANVIL_FEATURES="egl" - - FEATURES="anvil" ANVIL_FEATURES="winit" - - FEATURES="anvil" ANVIL_FEATURES="udev" - - FEATURES="anvil" ANVIL_FEATURES="logind" - - FEATURES="anvil" ANVIL_FEATURES="default" - - FEATURES="anvil" ANVIL_FEATURES="all" - -matrix: - fast_finish: true - include: - # continue testing the full crate on beta&nightly to spot rustc regressions - - rust: beta - env: FEATURES="all" - - rust: beta - env: FEATURES="anvil" ANVIL_FEATURES="all" - - rust: nightly - env: FEATURES="all" - - rust: nightly - env: FEATURES="anvil" ANVIL_FEATURES="all" - # special features for lint & fmt - - rust: stable - env: FEATURES="cargo-fmt" - - rust: nightly - env: FEATURES="cargo-clippy" - allow_failures: - - rust: nightly - -before_script: - - 'echo ubuntu-mirror: http://mirrors.us.kernel.org/ubuntu/ > ~/.vagga.yaml' - - 'echo alpine-mirror: http://mirrors.gigenet.com/alpinelinux/ >> ~/.vagga.yaml' - - | - echo "$(id -un):100000:65536" | sudo tee /etc/subuid | sudo tee /etc/subgid - sudo apt-get install uidmap -y - curl http://files.zerogw.com/vagga/vagga-install.sh | sh - - vagga update-$TRAVIS_RUST_VERSION - -script: - - | - case $FEATURES in - "all") - vagga cargo-$TRAVIS_RUST_VERSION test --all-features && - vagga cargo-$TRAVIS_RUST_VERSION doc --no-deps --all-features - ;; - "default") - vagga cargo-$TRAVIS_RUST_VERSION test && - vagga cargo-$TRAVIS_RUST_VERSION doc --no-deps - ;; - "examples") - vagga cargo-$TRAVIS_RUST_VERSION check --examples - ;; - "cargo-fmt") - vagga cargo-$TRAVIS_RUST_VERSION fmt --all -- --check - ;; - "cargo-clippy") - vagga cargo-$TRAVIS_RUST_VERSION clippy --all-features -- -D warnings - ;; - "anvil") - cd anvil - case $ANVIL_FEATURES in - "all") - vagga cargo-$TRAVIS_RUST_VERSION test --all-features - ;; - "default") - vagga cargo-$TRAVIS_RUST_VERSION test - ;; - *) - vagga cargo-$TRAVIS_RUST_VERSION check --no-default-features --features "$ANVIL_FEATURES" - esac - ;; - *) - vagga cargo-$TRAVIS_RUST_VERSION check --tests --no-default-features --features "$FEATURES" && - vagga cargo-$TRAVIS_RUST_VERSION doc --no-deps --no-default-features --features "$FEATURES" - esac - -after_success: - - cp ./doc_index.html ./target/doc/index.html - -deploy: - provider: pages - skip_cleanup: true - github_token: $GITHUB_TOKEN - local_dir: "./target/doc" - on: - branch: master - rust: nightly - condition: "$FEATURES = all" - -notifications: - webhooks: - urls: - - "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGxldmFucyUzQXNhZmFyYWRlZy5uZXQvJTIxRkt4aGprSUNwakJWelZlQ2RGJTNBc2FmYXJhZGVnLm5ldA" - on_success: change - on_failure: always - on_start: never diff --git a/README.md b/README.md index 2f49a8c..b1fede1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Crates.io](http://meritbadge.herokuapp.com/smithay)](https://crates.io/crates/smithay) [![docs.rs](https://docs.rs/smithay/badge.svg)](https://docs.rs/smithay) -[![Build Status](https://travis-ci.org/Smithay/smithay.svg?branch=master)](https://travis-ci.org/Smithay/smithay) +[![Build Status](https://github.com/Smithay/smithay/workflows/Continuous%20Integration/badge.svg)](https://github.com/Smithay/smithay/actions) [![Join the chat on matrix at @smithay:matrix.org](matrix_badge.svg)](https://matrix.to/#/#smithay:matrix.org) [![Join the chat via bridge on gitter at smithay/Lobby ](https://badges.gitter.im/smithay/Lobby.svg)](https://gitter.im/smithay/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) diff --git a/vagga.yaml b/vagga.yaml deleted file mode 100644 index 8173090..0000000 --- a/vagga.yaml +++ /dev/null @@ -1,82 +0,0 @@ -minimum-vagga: v0.5.0 - -containers: - base: - auto-clean: true - setup: - - !UbuntuRelease { codename: eoan } - - !UbuntuUniverse - - !Install [build-essential, wget, curl, pkg-config, file, openssl, sudo, ca-certificates, libssl-dev, cmake, libudev-dev, libgbm-dev, libxkbcommon-dev, libegl1-mesa-dev, libwayland-dev, libinput-dev, libsystemd-dev, libdbus-1-dev] - - stable: - auto-clean: true - environ: - HOME: /work/.vagga/stable-home - PATH: /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/work/.vagga/stable-home/.cargo/bin:/work/.vagga/stable-home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/ - RUST_BACKTRACE: 1 - XDG_RUNTIME_DIR: /work/.vagga/stable-home - setup: - - !Container base - - !Env HOME: /work/.vagga/stable-home - - !Sh curl https://sh.rustup.rs -sSf | sh -s -- -y --default-host x86_64-unknown-linux-gnu --default-toolchain stable --no-modify-path - - !Env PATH: /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/work/.vagga/stable-home/.cargo/bin:/work/.vagga/stable-home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/ - - !Sh rustup self update - - !Sh rustup component add rustfmt-preview - - beta: - auto-clean: true - environ: - HOME: /work/.vagga/beta-home - PATH: /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/work/.vagga/beta-home/.cargo/bin:/work/.vagga/beta-home/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/bin/ - RUST_BACKTRACE: 1 - XDG_RUNTIME_DIR: /work/.vagga/beta-home - setup: - - !Container base - - !Env HOME: /work/.vagga/beta-home - - !Sh curl https://sh.rustup.rs -sSf | sh -s -- -y --default-host x86_64-unknown-linux-gnu --default-toolchain beta --no-modify-path - - nightly: - auto-clean: true - environ: - HOME: /work/.vagga/nightly-home - PATH: /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/work/.vagga/nightly-home/.cargo/bin:/work/.vagga/nightly-home/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/ - RUST_BACKTRACE: 1 - XDG_RUNTIME_DIR: /work/.vagga/nightly-home - setup: - - !Container base - - !Env HOME: /work/.vagga/nightly-home - - !Sh curl https://sh.rustup.rs -sSf | sh -s -- -y --default-host x86_64-unknown-linux-gnu --default-toolchain nightly --no-modify-path - - !Env PATH: /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/work/.vagga/nightly-home/.cargo/bin:/work/.vagga/nightly-home/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/ - - !Sh rustup self update - - !Sh rustup component add clippy-preview - -commands: - update-stable: !Command - description: Update container - container: stable - run: rustup update - - update-beta: !Command - description: Update container - container: beta - run: rustup update - - update-nightly: !Command - description: Update container - container: nightly - run: rustup update - - cargo-stable: !Command - description: Run cargo - container: stable - run: ["/work/.vagga/stable-home/.cargo/bin/cargo"] - - cargo-beta: !Command - description: Run cargo - container: beta - run: ["/work/.vagga/beta-home/.cargo/bin/cargo"] - - cargo-nightly: !Command - description: Run cargo - container: nightly - run: ["/work/.vagga/nightly-home/.cargo/bin/cargo"]