From 20aef87675a48b8f326a872e1ee5fc11b7fa7e25 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 24 Oct 2020 14:26:45 +0200 Subject: [PATCH] CI: add a simple github action --- .github/workflows/CI.yml | 69 ++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 000000000000..422951df675c --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,69 @@ +on: + push: + branches: [master] + pull_request: + +name: CI + +jobs: + check: + runs-on: ubuntu-latest + container: + image: fedora:latest + strategy: + matrix: + rust: + - stable + - beta + - nightly + - "1.40.0" + steps: + - run: sudo dnf install -y gcc gtk3-devel graphene-devel glib2-devel git xorg-x11-server-Xvfb + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + - uses: actions-rs/cargo@v1 + name: "Docs" + with: + command: doc + - run: xvfb-run --auto-servernum cargo test + - uses: actions-rs/cargo@v1 + name: "Build" + with: + command: build + - run: git diff -R --exit-code + - name: Cleanup xvfb pidx + uses: bcomnes/cleanup-xvfb@v1 + + fmt: + name: rust fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + checker: + name: gtk-rs checker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + with: + repository: gtk-rs/checker + ref: master + path: checker + - working-directory: checker + run: cargo build --release + - run: "./checker/target/release/checker ." + - run: "./checker/check_init_asserts" diff --git a/Cargo.toml b/Cargo.toml index 51c624e445e1..4f825935b7ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,4 +27,4 @@ members = [ "pangocairo/sys", ] -exclude = ["gir"] +exclude = ["gir", "checker"]