diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b98ea17 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,73 @@ +name: Rust + +on: + push: + branches: [ "*" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + rustfmt: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install stable toolchain with rustfmt available + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt + + - name: Check format + run: cargo fmt --check + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + override: true + - name: Install Dependency + run: sudo apt-get -y update && sudo apt-get install -y pkg-config libatk1.0-dev libgtk-3-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev libxdo-dev libxkbcommon-x11-dev + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Check clippy + run: cargo clippy -- -D warnings + test-on-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install Dependency + run: sudo apt-get -y update && sudo apt-get install -y pkg-config libatk1.0-dev libgtk-3-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev libxdo-dev libxkbcommon-x11-dev + - name: Test + run: cargo test --workspace + test-on-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Test + run: cargo test --workspace + test-on-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Test + run: cargo test --workspace