Use new sctk api (#1901) #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Huge thanks to Alacritty, as their configuration served as a starting point for this one! | |
# See: https://github.com/alacritty/alacritty | |
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
WX_WIDGETS_BUILD_OUT_DIR: "${{github.workspace}}/wx-widgets-build" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: | | |
rustup component add rustfmt | |
cargo fmt --all -- --check | |
- name: Install Linux dependencies | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libx11-dev libxtst-dev libxkbcommon-dev libdbus-1-dev libwxgtk3.0-gtk3-dev | |
- name: Install rust-script and cargo-make | |
run: | | |
cargo install rust-script --version "0.7.0" | |
cargo install cargo-make --version 0.37.5 | |
# wxWidgets builds (internal to espanso-modulo) are by far the largest bottleneck | |
# in the current pipeline, so we cache the results for a faster compilation process | |
- name: "Cache wxWidgets builds" | |
if: ${{ runner.os != 'Linux' }} | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{env.WX_WIDGETS_BUILD_OUT_DIR}} | |
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('espanso-modulo/build.rs') }}-${{ hashFiles('espanso-modulo/vendor/*') }} | |
- name: Build | |
run: | | |
cargo make build-binary | |
- name: Check clippy | |
run: | | |
rustup component add clippy | |
cargo clippy -- -D warnings | |
env: | |
MACOSX_DEPLOYMENT_TARGET: "10.13" | |
test: | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: | | |
rustup component add rustfmt | |
cargo fmt --all -- --check | |
- name: Install Linux dependencies | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libx11-dev libxtst-dev libxkbcommon-dev libdbus-1-dev libwxgtk3.0-gtk3-dev | |
- name: Install rust-script and cargo-make | |
run: | | |
cargo install rust-script --version "0.7.0" | |
cargo install cargo-make --version 0.37.5 | |
- name: Run test suite | |
run: cargo make test-binary | |
build-wayland: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: | | |
rustup component add rustfmt | |
cargo fmt --all -- --check | |
- name: Install Linux dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libxkbcommon-dev libwxgtk3.0-gtk3-dev libdbus-1-dev | |
- name: Install rust-script and cargo-make | |
run: | | |
cargo install rust-script --version "0.7.0" | |
cargo install cargo-make --version 0.37.5 | |
- name: Build | |
run: cargo make --env NO_X11=true -- build-binary | |
- name: Check clippy | |
run: | | |
rustup component add clippy | |
cargo clippy -p espanso --features wayland -- -D warnings | |
test-wayland: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: | | |
rustup component add rustfmt | |
cargo fmt --all -- --check | |
- name: Install Linux dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libxkbcommon-dev libwxgtk3.0-gtk3-dev libdbus-1-dev | |
- name: Install rust-script and cargo-make | |
run: | | |
cargo install rust-script --version "0.7.0" | |
cargo install cargo-make --version 0.37.5 | |
- name: Run test suite | |
run: cargo make --env NO_X11=true -- test-binary | |
build-macos-arm: | |
runs-on: macos-11 | |
env: | |
WX_WIDGETS_BUILD_OUT_DIR: "${{github.workspace}}/wx-widgets-build" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install target | |
run: rustup update && rustup target add aarch64-apple-darwin | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install rust-script and cargo-make | |
run: | | |
cargo install rust-script --version "0.7.0" | |
cargo install cargo-make --version 0.37.5 | |
- name: "Cache wxWidgets builds" | |
if: ${{ runner.os != 'Linux' }} | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{env.WX_WIDGETS_BUILD_OUT_DIR}} | |
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('espanso-modulo/build.rs') }}-${{ hashFiles('espanso-modulo/vendor/*') }} | |
- name: Build | |
run: | | |
cargo make build-macos-arm-binary | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
# with: | |
# limit-access-to-actor: true |