2021-11-10 02:43:15 +00:00
|
|
|
name: Continuous Integration
|
|
|
|
|
2021-04-05 05:36:53 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
2021-06-23 09:56:59 +00:00
|
|
|
branches: main
|
2021-04-05 05:36:53 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
name: Check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-07-16 07:59:44 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2021-04-05 05:36:53 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
2023-07-16 07:59:44 +00:00
|
|
|
- run: cargo check
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
name: Rustfmt
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2021-04-05 05:36:53 +00:00
|
|
|
with:
|
2023-07-16 07:59:44 +00:00
|
|
|
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
|
2021-04-05 05:36:53 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
name: Test Suite
|
2021-11-10 02:43:15 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-07-16 07:59:44 +00:00
|
|
|
needs:
|
|
|
|
- check
|
|
|
|
- fmt
|
|
|
|
- clippy
|
|
|
|
- spellcheck
|
2021-11-10 02:43:15 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-16 07:59:44 +00:00
|
|
|
build:
|
|
|
|
- macos
|
|
|
|
- macos-aarch64
|
|
|
|
- linux
|
|
|
|
- linux-musl
|
2023-07-18 21:34:44 +00:00
|
|
|
- linux-aarch64
|
|
|
|
- linux-arm
|
2021-11-10 02:43:15 +00:00
|
|
|
rust: [stable]
|
|
|
|
include:
|
2023-07-16 07:59:44 +00:00
|
|
|
# See the list: https://github.com/cross-rs/cross
|
|
|
|
|
|
|
|
- build: macos
|
|
|
|
os: macos-latest
|
2021-11-10 02:43:15 +00:00
|
|
|
target: x86_64-apple-darwin
|
2023-07-16 07:59:44 +00:00
|
|
|
|
|
|
|
- build: macos-aarch64
|
|
|
|
os: macos-latest
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
|
|
|
|
- build: linux
|
|
|
|
os: ubuntu-latest
|
2021-11-10 02:43:15 +00:00
|
|
|
target: x86_64-unknown-linux-gnu
|
2023-07-16 07:59:44 +00:00
|
|
|
|
|
|
|
- build: linux-musl
|
|
|
|
os: ubuntu-latest
|
2021-11-10 02:43:15 +00:00
|
|
|
target: x86_64-unknown-linux-musl
|
|
|
|
|
2023-07-18 21:34:44 +00:00
|
|
|
- build: linux-aarch64
|
|
|
|
os: ubuntu-latest
|
|
|
|
target: aarch64-unknown-linux-gnu
|
2023-07-16 07:59:44 +00:00
|
|
|
|
2023-07-18 21:34:44 +00:00
|
|
|
- build: linux-arm
|
|
|
|
os: ubuntu-latest
|
|
|
|
target: arm-unknown-linux-gnueabihf
|
2023-07-16 07:59:44 +00:00
|
|
|
|
2021-10-17 11:50:06 +00:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: full
|
2021-04-05 05:36:53 +00:00
|
|
|
steps:
|
2023-07-16 07:59:44 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-10 02:43:15 +00:00
|
|
|
|
|
|
|
- name: Installing Rust toolchain
|
2023-07-16 07:59:44 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2021-04-05 05:36:53 +00:00
|
|
|
with:
|
2021-11-10 02:43:15 +00:00
|
|
|
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
|
2023-07-16 07:59:44 +00:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2021-11-10 02:43:15 +00:00
|
|
|
run: |
|
2023-01-13 06:33:04 +00:00
|
|
|
sudo apt-get update --fix-missing
|
2023-07-18 21:34:44 +00:00
|
|
|
sudo apt-get install -y --no-install-recommends liblua5.1-0-dev libluajit-5.1-dev gcc pkg-config curl git make ca-certificates
|
2021-11-10 02:43:15 +00:00
|
|
|
|
2023-07-18 21:34:44 +00:00
|
|
|
- if: matrix.build == 'linux-musl'
|
|
|
|
run: sudo apt-get install -y musl-tools
|
|
|
|
|
|
|
|
- if: matrix.build == 'linux-aarch64'
|
|
|
|
run: sudo apt-get install -y gcc-aarch64-linux-gnu
|
|
|
|
|
|
|
|
- if: matrix.build == 'linux-arm'
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -y gcc-multilib
|
|
|
|
sudo apt-get install -y gcc-arm-linux-gnueabihf
|
|
|
|
sudo ln -s /usr/include/asm-generic/ /usr/include/asm
|
2021-04-05 05:36:53 +00:00
|
|
|
|
2023-07-16 07:59:44 +00:00
|
|
|
- run: cargo build --target ${{ matrix.target }}
|
2023-07-18 21:34:44 +00:00
|
|
|
|
|
|
|
- if: matrix.build == 'macos' || matrix.build == 'linux'
|
|
|
|
run: cargo test --target ${{ matrix.target }}
|
2023-06-11 04:44:13 +00:00
|
|
|
|
2021-04-05 05:07:01 +00:00
|
|
|
# bench:
|
|
|
|
# name: Benchmarks
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
2023-07-16 07:59:44 +00:00
|
|
|
# - uses: actions/checkout@v3
|
|
|
|
# - uses: dtolnay/rust-toolchain@stable
|
2021-04-05 05:07:01 +00:00
|
|
|
# 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
|
2023-07-16 07:59:44 +00:00
|
|
|
# - run: cargo bench
|