From 60c37a1785098933aea5515104d8a5e41314bf6b Mon Sep 17 00:00:00 2001 From: Tarek Dakhran Date: Sun, 9 Jun 2024 19:56:09 +0200 Subject: [PATCH] Add basic CI functionality (#13) Run clippy and build for Linux and Windows --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5143d11 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: razer-ctl-ci + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends -y libudev-dev libxdo-dev librust-atk-dev libgtk-3-dev gcc-mingw-w64 + + - name: Install target for Windows + run: rustup target add x86_64-pc-windows-gnu + - name: Run clippy + run: cargo clippy --all-targets --all-features + - name: Build for Windows + run: cargo build --verbose --release --target x86_64-pc-windows-gnu + - name: Build for Linux + run: cargo build --verbose --release