2021-10-02 12:20:21 +00:00
|
|
|
# Huge thanks to Alacritty, as their configuration served as a starting point for this one!
|
|
|
|
# See: https://github.com/alacritty/alacritty
|
|
|
|
|
|
|
|
name: CI
|
|
|
|
|
2022-07-03 18:15:00 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- dev
|
|
|
|
pull_request:
|
2021-10-02 12:20:21 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest, macos-latest, ubuntu-latest]
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2022-07-03 18:15:00 +00:00
|
|
|
env:
|
|
|
|
WX_WIDGETS_BUILD_OUT_DIR: "${{github.workspace}}/wx-widgets-build"
|
|
|
|
|
2021-10-02 12:20:21 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-07-03 18:15:00 +00:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-10-05 21:20:07 +00:00
|
|
|
- name: Check formatting
|
|
|
|
run: |
|
|
|
|
rustup component add rustfmt
|
|
|
|
cargo fmt --all -- --check
|
2021-10-06 17:07:05 +00:00
|
|
|
- name: Install Linux dependencies
|
|
|
|
if: ${{ runner.os == 'Linux' }}
|
|
|
|
run: |
|
2021-10-16 10:08:32 +00:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y libx11-dev libxtst-dev libxkbcommon-dev libdbus-1-dev libwxgtk3.0-gtk3-dev
|
2022-07-03 18:15:00 +00:00
|
|
|
- name: Install rust-script and cargo-make
|
|
|
|
run: |
|
|
|
|
cargo install rust-script --version "0.7.0"
|
|
|
|
cargo install cargo-make --version 0.34.0
|
|
|
|
# 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
|
2021-10-05 21:20:07 +00:00
|
|
|
- name: Check clippy
|
|
|
|
run: |
|
|
|
|
rustup component add clippy
|
|
|
|
cargo clippy -- -D warnings
|
2021-10-14 17:37:47 +00:00
|
|
|
env:
|
|
|
|
MACOSX_DEPLOYMENT_TARGET: "10.13"
|
2022-07-03 18:15:00 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest, macos-latest, ubuntu-latest]
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
- 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
|
2021-12-11 15:31:57 +00:00
|
|
|
- name: Install rust-script and cargo-make
|
2021-10-02 12:20:21 +00:00
|
|
|
run: |
|
2021-12-11 15:31:57 +00:00
|
|
|
cargo install rust-script --version "0.7.0"
|
2022-07-03 18:15:00 +00:00
|
|
|
cargo install cargo-make --version 0.34.0
|
2021-10-02 12:20:21 +00:00
|
|
|
- name: Run test suite
|
2021-10-03 12:03:18 +00:00
|
|
|
run: cargo make test-binary
|
2021-10-02 12:20:21 +00:00
|
|
|
|
2021-10-03 11:14:26 +00:00
|
|
|
build-wayland:
|
2021-10-02 12:20:21 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-07-03 18:15:00 +00:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-10-05 21:20:07 +00:00
|
|
|
- name: Check formatting
|
|
|
|
run: |
|
|
|
|
rustup component add rustfmt
|
|
|
|
cargo fmt --all -- --check
|
2021-10-06 17:07:05 +00:00
|
|
|
- name: Install Linux dependencies
|
|
|
|
run: |
|
2021-10-16 10:08:32 +00:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y libxkbcommon-dev libwxgtk3.0-gtk3-dev libdbus-1-dev
|
2022-07-03 18:15:00 +00:00
|
|
|
- name: Install rust-script and cargo-make
|
|
|
|
run: |
|
|
|
|
cargo install rust-script --version "0.7.0"
|
|
|
|
cargo install cargo-make --version 0.34.0
|
|
|
|
- name: Build
|
|
|
|
run: cargo make build-binary --env NO_X11=true
|
2021-10-05 21:20:07 +00:00
|
|
|
- name: Check clippy
|
|
|
|
run: |
|
|
|
|
rustup component add clippy
|
|
|
|
cargo clippy -p espanso --features wayland -- -D warnings
|
2022-07-03 18:15:00 +00:00
|
|
|
|
|
|
|
test-wayland:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
- 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
|
2021-12-11 15:31:57 +00:00
|
|
|
- name: Install rust-script and cargo-make
|
2021-10-02 12:20:21 +00:00
|
|
|
run: |
|
2021-12-11 15:31:57 +00:00
|
|
|
cargo install rust-script --version "0.7.0"
|
2022-07-03 18:15:00 +00:00
|
|
|
cargo install cargo-make --version 0.34.0
|
2021-10-03 12:03:18 +00:00
|
|
|
- name: Run test suite
|
|
|
|
run: cargo make test-binary --env NO_X11=true
|
2021-10-02 12:20:21 +00:00
|
|
|
|
2021-10-03 11:14:26 +00:00
|
|
|
build-macos-arm:
|
2021-10-02 12:20:21 +00:00
|
|
|
runs-on: macos-11
|
2022-07-03 18:15:00 +00:00
|
|
|
env:
|
|
|
|
WX_WIDGETS_BUILD_OUT_DIR: "${{github.workspace}}/wx-widgets-build"
|
2021-10-02 12:20:21 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install target
|
|
|
|
run: rustup update && rustup target add aarch64-apple-darwin
|
2022-07-03 18:15:00 +00:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-12-11 15:31:57 +00:00
|
|
|
- name: Install rust-script and cargo-make
|
2021-10-02 12:22:12 +00:00
|
|
|
run: |
|
2021-12-11 15:31:57 +00:00
|
|
|
cargo install rust-script --version "0.7.0"
|
2022-07-03 18:15:00 +00:00
|
|
|
cargo install cargo-make --version 0.34.0
|
|
|
|
- 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/*') }}
|
2021-10-03 10:32:03 +00:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cargo make build-macos-arm-binary
|
2021-10-03 11:14:26 +00:00
|
|
|
# - name: Setup tmate session
|
|
|
|
# uses: mxschmitt/action-tmate@v3
|
|
|
|
# with:
|
|
|
|
# limit-access-to-actor: true
|