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
|
|
|
|
- name: Build ${{ matrix.lua }} vendored
|
2020-01-25 16:53:44 -05:00
|
|
|
run: |
|
2020-05-30 21:37:30 -04:00
|
|
|
cargo build --release --features "${{ matrix.lua }} vendored"
|
|
|
|
cargo build --release --features "${{ matrix.lua }} vendored async send"
|
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: |
|
|
|
|
sudo apt-get update -y
|
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
|
2020-05-30 21:37:30 -04:00
|
|
|
cargo build --release --features "${{ matrix.lua }}"
|
2020-01-25 16:53:44 -05:00
|
|
|
|
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]
|
|
|
|
rust: [stable]
|
|
|
|
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
|
|
|
|
- name: Run ${{ matrix.lua }} tests
|
2020-05-16 10:13:38 -04:00
|
|
|
if: ${{ matrix.os != 'macos-latest' || matrix.lua != 'luajit' }}
|
2020-01-25 16:53:44 -05:00
|
|
|
run: |
|
2020-05-30 21:37:30 -04:00
|
|
|
cargo test --release --features "${{ matrix.lua }} vendored"
|
|
|
|
cargo test --release --features "${{ matrix.lua }} vendored async send"
|
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: |
|
2020-10-27 19:03:23 -04:00
|
|
|
TRYBUILD=overwrite cargo test --release --features "${{ matrix.lua }} vendored" -- --ignored
|
|
|
|
TRYBUILD=overwrite cargo test --release --features "${{ matrix.lua }} vendored async send" -- --ignored
|
2020-01-25 16:53:44 -05:00
|
|
|
shell: bash
|
|
|
|
|
2020-05-31 07:16:47 -04:00
|
|
|
test_luajit_macos:
|
2020-05-16 10:13:38 -04:00
|
|
|
name: Test LuaJIT on macOS
|
|
|
|
runs-on: macos-latest
|
|
|
|
needs: build
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
override: true
|
|
|
|
- name: Run LuaJIT 2.0.5 tests
|
|
|
|
run: |
|
|
|
|
brew install luajit pkg-config
|
2020-06-07 21:14:29 -04:00
|
|
|
cargo test --tests --release --features "luajit async send" -- --test-threads=1
|
2020-05-16 10:13:38 -04:00
|
|
|
shell: bash
|
|
|
|
- name: Run LuaJIT vendored tests
|
|
|
|
run: |
|
2020-05-30 21:37:30 -04:00
|
|
|
cargo test --release --features "luajit vendored async send"
|
2020-05-16 10:13:38 -04:00
|
|
|
shell: bash
|
|
|
|
|
2020-05-31 07:16:47 -04:00
|
|
|
test_modules:
|
|
|
|
name: Test modules on Linux and macOS
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-18.04, macos-latest]
|
|
|
|
rust: [stable]
|
|
|
|
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
|
|
|
|
- name: Run ${{ matrix.lua }} module tests
|
|
|
|
run: |
|
|
|
|
(cd examples/module && cargo build --release --features "${{ matrix.lua }} vendored")
|
|
|
|
(cd tests/module && cargo test --release --features "${{ matrix.lua }} vendored")
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
test_modules_windows:
|
|
|
|
name: Test modules on Windows
|
|
|
|
runs-on: windows-latest
|
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
lua: [lua53, lua51, luajit]
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash.exe --login -eo pipefail "{0}"
|
|
|
|
env:
|
|
|
|
MSYSTEM: MINGW64
|
|
|
|
CHERE_INVOKING: 1
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up shell
|
|
|
|
run: echo ::add-path::C:\msys64\usr\bin\
|
|
|
|
shell: pwsh
|
|
|
|
- name: Install Rust & Lua
|
|
|
|
run: |
|
|
|
|
pacman -S --noconfirm mingw-w64-x86_64-rust mingw-w64-x86_64-lua mingw-w64-x86_64-lua51 mingw-w64-x86_64-luajit
|
|
|
|
- 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 }}
|
2020-06-01 16:36:59 -04:00
|
|
|
args: --features "${{ matrix.lua }},async,send,vendored
|