fmt #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
name: Rust | |
on: | |
push: | |
branches: | |
- 'main' | |
- '!gh-pages' | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
RUST_BACKTRACE: 1 | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install C deps | |
run: | | |
set -x | |
sudo apt-get install libibus-1.0-dev just | |
shell: bash | |
- name: Install bindgen | |
run: | | |
set -x | |
mkdir bindgen && cd bindgen | |
sudo apt-get install libclang1 | |
URL_ROOT=https://github.com/rust-lang/rust-bindgen/releases/download/latest | |
BINDGEN_TAR=bindgen-cli-x86_64-unknown-linux-gnu.tar.xz | |
SHA256_FILE=${BINDGEN_TAR}.sha256 | |
wget "$URL_ROOT/$BINDGEN_TAR" -O bindgen_cli.tar.xz | |
tar -xf ./bindgen_cli.tar.xz --strip-components=1 | |
echo "$(pwd)" >> $GITHUB_PATH | |
shell: bash | |
- run: bindgen --version | |
- run: | | |
set -x | |
just ffi --yes | |
git diff | |
- run: just build | |
- run: cargo test | |
- run: cd vncharset && cargo test | |
msrv: | |
runs-on: ubuntu-latest | |
if: false | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
# add_of_mut! requires for soundness | |
MSRV: 1.51.0 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup toolchain install ${{ env.MSRV }} | |
rustup default ${{ env.MSRV }} | |
- run: | | |
rustup run stable cargo generate-lockfile | |
rustup run stable cargo fetch | |
- run: | | |
cargo build --all-targets --locked | |
- run: | | |
cargo test | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: cargo fmt --all -- --check | |
clippy: | |
if: false | |
runs-on: ubuntu-latest | |
needs: [build] | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup toolchain install nightly -c clippy | |
rustup default nightly | |
- run: cargo clippy --all-targets --all-features -- -Dwarnings | |