2020-01-25 16:53:44 -05:00
|
|
|
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-05-11 20:43:42 -04:00
|
|
|
os: [ubuntu-18.04, macos-latest, windows-latest]
|
|
|
|
rust: [stable]
|
|
|
|
lua: [lua54, lua53, lua52, lua51, luajit]
|
2020-01-25 16:53:44 -05:00
|
|
|
include:
|
2020-05-11 20:43:42 -04:00
|
|
|
- os: ubuntu-18.04
|
2020-01-25 16:53:44 -05:00
|
|
|
target: x86_64-unknown-linux-gnu
|
2020-05-11 20:43:42 -04:00
|
|
|
- os: macos-latest
|
2020-01-25 16:53:44 -05:00
|
|
|
target: x86_64-apple-darwin
|
2020-05-11 20:43:42 -04:00
|
|
|
- os: windows-latest
|
2020-01-25 16:53:44 -05:00
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
steps:
|
2020-05-11 20:43:42 -04:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
override: true
|
2021-07-13 07:14:34 -04:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2020-05-11 20:43:42 -04:00
|
|
|
- name: Build ${{ matrix.lua }} vendored
|
2020-01-25 16:53:44 -05:00
|
|
|
run: |
|
2021-07-13 07:14:34 -04:00
|
|
|
cargo build --features "${{ matrix.lua }},vendored"
|
|
|
|
cargo build --features "${{ matrix.lua }},vendored,async,send,serialize,macros"
|
2020-01-25 16:53:44 -05:00
|
|
|
shell: bash
|
2020-05-11 20:43:42 -04:00
|
|
|
- name: Build ${{ matrix.lua }} pkg-config
|
|
|
|
if: ${{ matrix.os == 'ubuntu-18.04' && matrix.lua != 'lua54' }}
|
2020-01-25 16:53:44 -05:00
|
|
|
run: |
|
2021-01-16 08:32:38 -05:00
|
|
|
sudo apt-get update
|
2020-05-11 20:43:42 -04:00
|
|
|
sudo apt-get install -y --no-install-recommends liblua5.3-dev liblua5.2-dev liblua5.1-0-dev libluajit-5.1-dev
|
2021-07-13 07:14:34 -04:00
|
|
|
cargo build --features "${{ matrix.lua }}"
|
2020-01-25 16:53:44 -05:00
|
|
|
|
2021-01-16 08:32:38 -05:00
|
|
|
build_aarch64_cross_macos:
|
|
|
|
name: Cross-compile to aarch64-apple-darwin
|
|
|
|
runs-on: macos-11.0
|
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
lua: [lua54, lua53, lua52, lua51, luajit]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-07-13 07:14:34 -04:00
|
|
|
toolchain: stable
|
2021-01-16 08:32:38 -05:00
|
|
|
target: aarch64-apple-darwin
|
|
|
|
override: true
|
|
|
|
- name: Cross-compile
|
2021-05-05 16:55:49 -04:00
|
|
|
run: cargo build --target aarch64-apple-darwin --features "${{ matrix.lua }},vendored,async,send,serialize,macros"
|
2021-01-16 08:32:38 -05:00
|
|
|
|
|
|
|
build_aarch64_cross_ubuntu:
|
|
|
|
name: Cross-compile to aarch64-unknown-linux-gnu
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
lua: [lua54, lua53, lua52, lua51, luajit]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-07-13 07:14:34 -04:00
|
|
|
toolchain: stable
|
2021-01-16 08:32:38 -05:00
|
|
|
target: aarch64-unknown-linux-gnu
|
|
|
|
override: true
|
|
|
|
- name: Install ARM compiler toolchain
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
|
|
|
shell: bash
|
|
|
|
- name: Cross-compile
|
2021-05-05 16:55:49 -04:00
|
|
|
run: cargo build --target aarch64-unknown-linux-gnu --features "${{ matrix.lua }},vendored,async,send,serialize,macros"
|
2021-01-16 08:32:38 -05:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
build_armv7_cross_ubuntu:
|
|
|
|
name: Cross-compile to armv7-unknown-linux-gnueabihf
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
lua: [lua54, lua53, lua52, lua51]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-07-13 07:14:34 -04:00
|
|
|
toolchain: stable
|
2021-01-16 08:32:38 -05:00
|
|
|
target: armv7-unknown-linux-gnueabihf
|
|
|
|
override: true
|
|
|
|
- name: Install ARM compiler toolchain
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y --no-install-recommends gcc-arm-linux-gnueabihf libc-dev-armhf-cross
|
|
|
|
shell: bash
|
|
|
|
- name: Cross-compile
|
2021-05-05 16:55:49 -04:00
|
|
|
run: cargo build --target armv7-unknown-linux-gnueabihf --features "${{ matrix.lua }},vendored,async,send,serialize,macros"
|
2021-01-16 08:32:38 -05:00
|
|
|
shell: bash
|
|
|
|
|
2020-05-11 20:43:42 -04:00
|
|
|
test:
|
|
|
|
name: Test
|
|
|
|
runs-on: ${{ matrix.os }}
|
2020-01-25 16:53:44 -05:00
|
|
|
needs: build
|
2020-05-11 20:43:42 -04:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-18.04, macos-latest, windows-latest]
|
2021-03-30 06:50:09 -04:00
|
|
|
rust: [stable, nightly]
|
2020-05-11 20:43:42 -04:00
|
|
|
lua: [lua54, lua53, lua52, lua51, luajit]
|
|
|
|
include:
|
|
|
|
- os: ubuntu-18.04
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
- os: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
- os: windows-latest
|
|
|
|
target: x86_64-pc-windows-msvc
|
2020-01-25 16:53:44 -05:00
|
|
|
steps:
|
2020-05-11 20:43:42 -04:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
override: true
|
2021-07-13 07:14:34 -04:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2020-05-11 20:43:42 -04:00
|
|
|
- name: Run ${{ matrix.lua }} tests
|
2020-01-25 16:53:44 -05:00
|
|
|
run: |
|
2021-07-13 07:14:34 -04:00
|
|
|
cargo test --features "${{ matrix.lua }},vendored"
|
|
|
|
cargo test --features "${{ matrix.lua }},vendored,async,send,serialize,macros"
|
2020-01-25 16:53:44 -05:00
|
|
|
shell: bash
|
2020-07-27 06:34:48 -04:00
|
|
|
- name: Run compile tests (macos lua53)
|
|
|
|
if: ${{ matrix.os == 'macos-latest' && matrix.lua == 'lua53' }}
|
2020-05-11 20:43:42 -04:00
|
|
|
run: |
|
2021-07-13 07:14:34 -04:00
|
|
|
TRYBUILD=overwrite cargo test --features "${{ matrix.lua }},vendored" -- --ignored
|
|
|
|
TRYBUILD=overwrite cargo test --features "${{ matrix.lua }},vendored,async,send,serialize,macros" -- --ignored
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
test_with_sanitizer:
|
|
|
|
name: Test with address sanitizer
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-18.04]
|
|
|
|
rust: [nightly]
|
|
|
|
lua: [lua54, lua53, lua52, lua51, luajit]
|
|
|
|
include:
|
|
|
|
- os: ubuntu-18.04
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
override: true
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Run ${{ matrix.lua }} tests with address sanitizer
|
|
|
|
run: |
|
|
|
|
RUSTFLAGS="-Z sanitizer=address" \
|
|
|
|
cargo test --tests --features "${{ matrix.lua }},vendored,async,send,serialize,macros" --target x86_64-unknown-linux-gnu -- --skip test_too_many_recursions
|
2020-01-25 16:53:44 -05:00
|
|
|
shell: bash
|
|
|
|
|
2020-05-31 07:16:47 -04:00
|
|
|
test_modules:
|
2021-01-16 08:32:38 -05:00
|
|
|
name: Test modules
|
2020-05-31 07:16:47 -04:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-18.04, macos-latest]
|
2021-07-13 07:14:34 -04:00
|
|
|
rust: [stable]
|
2020-05-31 07:16:47 -04:00
|
|
|
lua: [lua54, lua53, lua52, lua51, luajit]
|
|
|
|
include:
|
|
|
|
- os: ubuntu-18.04
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
- os: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
override: true
|
2021-07-13 07:14:34 -04:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2020-05-31 07:16:47 -04:00
|
|
|
- name: Run ${{ matrix.lua }} module tests
|
|
|
|
run: |
|
2021-05-05 16:55:49 -04:00
|
|
|
(cd examples/module && cargo build --release --features "${{ matrix.lua }},vendored")
|
|
|
|
(cd tests/module && cargo test --release --features "${{ matrix.lua }},vendored")
|
2020-05-31 07:16:47 -04:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
test_modules_windows:
|
|
|
|
name: Test modules on Windows
|
|
|
|
runs-on: windows-latest
|
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-04-27 05:38:20 -04:00
|
|
|
lua: [lua54, luajit]
|
2020-05-31 07:16:47 -04:00
|
|
|
defaults:
|
|
|
|
run:
|
2020-12-12 15:37:17 -05:00
|
|
|
shell: msys2 {0}
|
2020-05-31 07:16:47 -04:00
|
|
|
steps:
|
2020-12-12 15:37:17 -05:00
|
|
|
- uses: msys2/setup-msys2@v2
|
2020-05-31 07:16:47 -04:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install Rust & Lua
|
|
|
|
run: |
|
2020-12-12 15:37:17 -05:00
|
|
|
pacman -S --noconfirm mingw-w64-x86_64-rust mingw-w64-x86_64-lua mingw-w64-x86_64-luajit mingw-w64-x86_64-pkg-config
|
2020-05-31 07:16:47 -04:00
|
|
|
- name: Run ${{ matrix.lua }} module tests
|
|
|
|
run: |
|
|
|
|
(cd examples/module && cargo build --release --features "${{ matrix.lua }}")
|
|
|
|
(cd tests/module && cargo test --release --features "${{ matrix.lua }}")
|
|
|
|
|
2020-01-25 16:53:44 -05:00
|
|
|
rustfmt:
|
|
|
|
name: Rustfmt
|
2020-05-11 20:43:42 -04:00
|
|
|
runs-on: ubuntu-18.04
|
2020-01-25 16:53:44 -05:00
|
|
|
steps:
|
2020-05-11 20:43:42 -04:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
components: rustfmt
|
|
|
|
override: true
|
2020-01-25 16:53:44 -05:00
|
|
|
- run: cargo fmt -- --check
|
2020-05-12 18:34:42 -04:00
|
|
|
|
|
|
|
clippy:
|
|
|
|
name: Clippy check
|
|
|
|
runs-on: ubuntu-18.04
|
2020-06-01 16:36:59 -04:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
lua: [lua54, lua53, lua52, lua51, luajit]
|
2020-05-12 18:34:42 -04:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: clippy
|
|
|
|
override: true
|
|
|
|
- uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-05-05 16:55:49 -04:00
|
|
|
args: --features "${{ matrix.lua }},vendored,async,send,serialize,macros"
|