feat: add codespell lint job into workflows & fix typos #282
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: Build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
features: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
feature: | |
- bolt | |
- bifrost | |
- serde,bolt | |
- serde,bifrost | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Feature ${{ matrix.feature }} | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --no-default-features --features=${{ matrix.feature }} | |
- name: Defaults + ${{ matrix.feature }} | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --features=${{ matrix.feature }} | |
platforms: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-18.04, ubuntu-latest, macos-10.15, macos-11.0, windows-latest ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install macos dependencies | |
if: startsWith(matrix.os, 'macos') | |
run: brew install pkg-config | |
- name: Install rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Build with no features | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --workspace --no-default-features --features bolt | |
- name: Build with defaults | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --workspace --all-targets --all-features | |
toolchains: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [ nightly, beta, stable, 1.59.0 ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install rust ${{ matrix.toolchain }} | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
override: true | |
- name: Regenerate Cargo.lock | |
if: startsWith(matrix.toolchain, '1.') | |
uses: actions-rs/cargo@v1 | |
with: | |
command: generate-lockfile | |
- name: Pin versions | |
if: startsWith(matrix.toolchain, '1.') | |
uses: actions-rs/cargo@v1 | |
with: | |
command: update | |
args: -p zeroize --precise "1.2.0" | |
- name: All features | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --workspace --all-targets --all-features | |
dependency: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install latest stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Create dependency | |
run: | | |
cargo new dep_test | |
cp contrib/depCargo.toml dep_test/Cargo.toml | |
cd dep_test | |
- name: Build dependency | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --verbose | |
- name: Clean up | |
run: | | |
cd .. | |
rm -rf dep_test | |
android: | |
runs-on: ubuntu-latest | |
env: | |
NDK_VERSION: 20.1.5948944 | |
ANDROID_CLI_ZIP: commandlinetools-linux-6858069_latest.zip | |
ANDROID_CLI_SHA256: 87f6dcf41d4e642e37ba03cb2e387a542aa0bd73cb689a9e7152aad40a6e7a08 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: set environment variables | |
run: | | |
ANDROID_SDK_ROOT="$GITHUB_WORKSPACE/sdk" | |
NDK_HOME="$ANDROID_SDK_ROOT/ndk/$NDK_VERSION" | |
echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" >> $GITHUB_ENV | |
echo "NDK_HOME=$NDK_HOME" >> $GITHUB_ENV | |
echo "PATH=$PATH:$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_ENV | |
- name: Install NDK | |
run: | | |
wget -nv https://dl.google.com/android/repository/$ANDROID_CLI_ZIP | |
echo "$ANDROID_CLI_SHA256 $ANDROID_CLI_ZIP" > SHA256SUMS | |
sha256sum -c SHA256SUMS | |
unzip $ANDROID_CLI_ZIP | |
mkdir -p $ANDROID_SDK_ROOT/cmdline-tools && mv cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/3.0 | |
yes 2>/dev/null | $ANDROID_SDK_ROOT/cmdline-tools/3.0/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT \ | |
"build-tools;29.0.3" "platforms;android-29" "ndk;$NDK_VERSION" |grep -v '\[='; true | |
- name: Add rust targets | |
run: | | |
rustup target add aarch64-linux-android x86_64-linux-android armv7-linux-androideabi i686-linux-android | |
- name: Build for aarch64-linux-android | |
run: | | |
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang" | |
export CC="aarch64-linux-android21-clang" | |
export CFLAGS="--sysroot=$NDK_HOME/sysroot -I$NDK_HOME/sysroot/usr/include -I$NDK_HOME/sysroot/usr/include/aarch64-linux-android" | |
export CXX="aarch64-linux-android21-clang++" | |
export CXXFLAGS="$CFLAGS -nostdlib++ -I$NDK_HOME/sources/cxx-stl/llvm-libc++/include" | |
export LDFLAGS="--sysroot=$NDK_HOME/platforms/android-21/arch-arm64" | |
cargo check --all-features --target=aarch64-linux-android | |
- name: Build for x86_64-linux-android | |
run: | | |
export CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang" | |
export CC="x86_64-linux-android21-clang" | |
export CFLAGS="--sysroot=$NDK_HOME/sysroot -I$NDK_HOME/sysroot/usr/include -I$NDK_HOME/sysroot/usr/include/x86_64-linux-android" | |
export CXX="x86_64-linux-android21-clang++" | |
export CXXFLAGS="$CFLAGS -nostdlib++ -I$NDK_HOME/sources/cxx-stl/llvm-libc++/include" | |
export LDFLAGS="--sysroot=$NDK_HOME/platforms/android-21/arch-x86_64" | |
cargo check --all-features --target=x86_64-linux-android | |
- name: Build for armv7-linux-androideabi | |
run: | | |
export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang" | |
export CC="armv7a-linux-androideabi21-clang" | |
export CFLAGS="--sysroot=$NDK_HOME/sysroot -I$NDK_HOME/sysroot/usr/include -I$NDK_HOME/sysroot/usr/include/arm-linux-androideabi" | |
export CXX="armv7a-linux-androideabi21-clang++" | |
export CXXFLAGS="$CFLAGS -nostdlib++ -I$NDK_HOME/sources/cxx-stl/llvm-libc++/include" | |
export LDFLAGS="--sysroot=$NDK_HOME/platforms/android-21/arch-arm -L$NDK_HOME/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a" | |
cargo check --all-features --target=armv7-linux-androideabi | |
- name: Build for i686-linux-android | |
run: | | |
export CARGO_TARGET_I686_LINUX_ANDROID_LINKER="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android26-clang" | |
export CC="i686-linux-android21-clang" | |
export CFLAGS="--sysroot=$NDK_HOME/sysroot -I$NDK_HOME/sysroot/usr/include -I$NDK_HOME/sysroot/usr/include/i686-linux-android" | |
export CXX="i686-linux-android21-clang++" | |
export CXXFLAGS="$CFLAGS -nostdlib++ -I$NDK_HOME/sources/cxx-stl/llvm-libc++/include" | |
export LDFLAGS="--sysroot=$NDK_HOME/platforms/android-21/arch-x86" | |
cargo check --all-features --target=i686-linux-android | |
ios: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Dependencies and targets | |
run: | | |
rustup target add aarch64-apple-ios x86_64-apple-ios | |
cargo install cargo-lipo | |
- name: build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: lipo | |
args: --all-features --verbose |