-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add Continuous Integration workflow
- Loading branch information
Showing
6 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Based on: https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/ci.yml | ||
name: Continuous Integration | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
rust: [stable] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install common dependencies | ||
run: ci/install-common-deps-ubuntu | ||
|
||
- name: Install rofi dependencies | ||
run: ci/install-rofi-deps-ubuntu | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
|
||
- name: Build all crates | ||
# The --workspace refers to all crates in the project | ||
run: cargo build --verbose --workspace | ||
|
||
- name: Run tests | ||
run: cargo test --verbose --workspace | ||
|
||
rustfmt: | ||
name: rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
- name: Check formatting | ||
run: cargo fmt --all --check | ||
|
||
docs: | ||
name: Docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
|
||
- name: Install common dependencies | ||
run: ci/install-common-deps-ubuntu | ||
|
||
- name: Install rofi dependencies | ||
run: ci/install-rofi-deps-ubuntu | ||
|
||
- name: Check documentation | ||
env: | ||
RUSTDOCFLAGS: -D warnings | ||
run: cargo doc --no-deps --document-private-items --workspace |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.cache/ | ||
/target | ||
|
||
.devcontainer/ |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
# This script will install just the essential packages to build | ||
# the standalone executable (not the rofi mode) | ||
|
||
# A very minimal environment might not contain sudo | ||
if ! command -V sudo; then | ||
apt-get update | ||
apt-get install -y --no-install-recommends sudo | ||
fi | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends \ | ||
pkg-config libsqlite3-dev |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
# A very minimal environment might not contain sudo | ||
if ! command -V sudo; then | ||
apt-get update | ||
apt-get install -y --no-install-recommends sudo | ||
fi | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends \ | ||
rofi-dev libpango1.0-dev |