You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xplr/.github/workflows/ci.yml

155 lines
4.0 KiB
YAML

name: Continuous Integration
on:
pull_request:
push:
branches: main
workflow_dispatch:
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: cargo check
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- run: cargo clippy -- -D warnings
spellcheck:
name: Spellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: codespell-project/actions-codespell@v1
with:
ignore_words_file: .codespellignore
test:
name: Test Suite
runs-on: ${{ matrix.os }}
needs:
- check
- fmt
- clippy
- spellcheck
strategy:
matrix:
build:
- macos
- macos-aarch64
- linux
- linux-musl
- aarch64-linux
# - aarch64-linux-musl
- aarch64-android
# - armv7-linux
rust: [stable]
include:
# See the list: https://github.com/cross-rs/cross
- build: macos
os: macos-latest
target: x86_64-apple-darwin
binary_postfix: ""
- build: macos-aarch64
os: macos-latest
target: aarch64-apple-darwin
binary_postfix: ""
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary_postfix: ""
- build: linux-musl
os: ubuntu-latest
target: x86_64-unknown-linux-musl
binary_postfix: ""
- build: aarch64-linux
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
binary_postfix: ""
# - build: aarch64-linux-musl
# os: ubuntu-latest
# target: aarch64-unknown-linux-musl
# binary_postfix: ""
- build: aarch64-android
os: ubuntu-latest
target: aarch64-linux-android
binary_postfix: ""
# - build: armv7-linux
# os: ubuntu-latest
# target: armv7-unknown-linux-gnueabihf
# binary_postfix: ""
env:
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v3
- name: Installing Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: Installing needed macOS dependencies
if: matrix.os == 'macos-latest'
run: brew install openssl@1.1
- name: Installing needed Ubuntu dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y --no-install-recommends liblua5.1-0-dev libluajit-5.1-dev
- if: matrix.os == 'ubuntu-latest' && contains(matrix.build, 'armv7')
run: sudo apt-get install -y --no-install-recommends gcc-arm-linux-gnueabihf libc-dev-armhf-cross
- if: matrix.os == 'ubuntu-latest' && contains(matrix.build, 'aarch64')
run: sudo apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu libc6-dev-arm64-cross
- run: cargo build --target ${{ matrix.target }}
- run: cargo test --target ${{ matrix.target }}
# bench:
# name: Benchmarks
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# with:
# toolchain: stable
# # These dependencies are required for `clipboard`
# - run: sudo apt-get install -y -qq libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
# - run: cargo bench