Skip to content

Commit

Permalink
ci: try new ci template
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Apr 21, 2024
1 parent b97e695 commit 79ef3af
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
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
shell: bash
- name: install just
run: |
set -x
# create ~/bin
mkdir -p ~/bin
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin
export PATH="$PATH:$HOME/bin"
echo "$HOME/bin" >> $GITHUB_PATH
- 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/v0.69.4
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: |
set -x
just --yes ffi
git diff | grep 'diff --git' && false
- 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

4 changes: 3 additions & 1 deletion vncharset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ impl<'a> Vni<'a> {
dbg!(&out);
}
}
Mac => {unimplemented!()}
Mac => {
unimplemented!()
}
}
out
}
Expand Down

0 comments on commit 79ef3af

Please sign in to comment.