mlua/.github/workflows/main.yml

234 lines
7.7 KiB
YAML
Raw Normal View History

2020-01-25 15:53:44 -06:00
name: CI
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
2022-09-12 17:29:05 -05:00
os: [ubuntu-22.04, macos-latest, windows-latest]
2020-05-11 19:43:42 -05:00
rust: [stable]
2022-02-19 08:15:15 -06:00
lua: [lua54, lua53, lua52, lua51, luajit, luau]
2020-01-25 15:53:44 -06:00
include:
2022-09-12 17:29:05 -05:00
- os: ubuntu-22.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 15:53:44 -06:00
steps:
2022-09-12 17:29:05 -05:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Build ${{ matrix.lua }} vendored
run: |
cargo build --features "${{ matrix.lua }},vendored"
cargo build --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
shell: bash
- name: Build ${{ matrix.lua }} pkg-config
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends liblua5.4-dev liblua5.3-dev liblua5.2-dev liblua5.1-0-dev libluajit-5.1-dev
cargo build --features "${{ matrix.lua }}"
2020-01-25 15:53:44 -06:00
2021-01-16 07:32:38 -06:00
build_aarch64_cross_macos:
name: Cross-compile to aarch64-apple-darwin
runs-on: macos-latest
2021-01-16 07:32:38 -06:00
needs: build
strategy:
matrix:
lua: [lua54, lua53, lua52, lua51, luajit]
steps:
2022-09-12 17:29:05 -05:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: aarch64-apple-darwin
- name: Cross-compile
run: cargo build --target aarch64-apple-darwin --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
2021-01-16 07:32:38 -06:00
build_aarch64_cross_ubuntu:
name: Cross-compile to aarch64-unknown-linux-gnu
2022-09-12 17:29:05 -05:00
runs-on: ubuntu-22.04
2021-01-16 07:32:38 -06:00
needs: build
strategy:
matrix:
lua: [lua54, lua53, lua52, lua51, luajit]
steps:
2022-09-12 17:29:05 -05:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: aarch64-unknown-linux-gnu
- 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
run: cargo build --target aarch64-unknown-linux-gnu --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
shell: bash
2021-01-16 07:32:38 -06:00
build_armv7_cross_ubuntu:
name: Cross-compile to armv7-unknown-linux-gnueabihf
2022-09-12 17:29:05 -05:00
runs-on: ubuntu-22.04
2021-01-16 07:32:38 -06:00
needs: build
strategy:
matrix:
lua: [lua54, lua53, lua52, lua51]
steps:
2022-09-12 17:29:05 -05:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: armv7-unknown-linux-gnueabihf
- 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
run: cargo build --target armv7-unknown-linux-gnueabihf --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
shell: bash
2021-01-16 07:32:38 -06:00
2020-05-11 19:43:42 -05:00
test:
name: Test
runs-on: ${{ matrix.os }}
2020-01-25 15:53:44 -06:00
needs: build
2020-05-11 19:43:42 -05:00
strategy:
matrix:
2022-09-12 17:29:05 -05:00
os: [ubuntu-22.04, macos-latest, windows-latest]
2021-03-30 05:50:09 -05:00
rust: [stable, nightly]
2022-02-19 08:15:15 -06:00
lua: [lua54, lua53, lua52, lua51, luajit, luajit52, luau]
2020-05-11 19:43:42 -05:00
include:
2022-09-12 17:29:05 -05:00
- os: ubuntu-22.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 15:53:44 -06:00
steps:
2022-09-12 17:29:05 -05:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v1
- name: Run ${{ matrix.lua }} tests
run: |
cargo test --features "${{ matrix.lua }},vendored"
cargo test --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
shell: bash
- name: Run compile tests (macos lua54)
if: ${{ matrix.os == 'macos-latest' && matrix.lua == 'lua54' }}
run: |
TRYBUILD=overwrite cargo test --features "${{ matrix.lua }},vendored" -- --ignored
TRYBUILD=overwrite cargo test --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot" -- --ignored
shell: bash
test_with_sanitizer:
name: Test with address sanitizer
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
2022-09-12 17:29:05 -05:00
os: [ubuntu-22.04]
rust: [nightly]
2022-02-19 08:15:15 -06:00
lua: [lua54, lua53, lua52, lua51, luajit, luau]
include:
2022-09-12 17:29:05 -05:00
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
steps:
2022-09-12 17:29:05 -05:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- 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,parking_lot" --target x86_64-unknown-linux-gnu -- --skip test_too_many_recursions
shell: bash
2020-01-25 15:53:44 -06:00
test_modules:
2021-01-16 07:32:38 -06:00
name: Test modules
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
2022-09-12 17:29:05 -05:00
os: [ubuntu-22.04, macos-latest]
rust: [stable]
lua: [lua54, lua53, lua52, lua51, luajit]
include:
2022-09-12 17:29:05 -05:00
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
steps:
2022-09-12 17:29:05 -05:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v1
- name: Run ${{ matrix.lua }} module tests
run: |
(cd tests/module && cargo build --release --features "${{ matrix.lua }}")
(cd tests/module/loader && 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: [lua54, luajit]
defaults:
run:
2020-12-12 14:37:17 -06:00
shell: msys2 {0}
steps:
2022-09-12 17:29:05 -05:00
- uses: msys2/setup-msys2@v2
- uses: actions/checkout@v3
- name: Install Rust & Lua
run: |
pacman -S --noconfirm mingw-w64-x86_64-rust mingw-w64-x86_64-lua mingw-w64-x86_64-luajit mingw-w64-x86_64-pkg-config
- name: Run ${{ matrix.lua }} module tests
run: |
(cd tests/module && cargo build --release --features "${{ matrix.lua }}")
(cd tests/module/loader && cargo test --release --features "${{ matrix.lua }}")
2020-01-25 15:53:44 -06:00
rustfmt:
name: Rustfmt
2022-09-12 17:29:05 -05:00
runs-on: ubuntu-22.04
2020-01-25 15:53:44 -06:00
steps:
2022-09-12 17:29:05 -05:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- run: cargo fmt -- --check
clippy:
name: Clippy check
2022-09-12 17:29:05 -05:00
runs-on: ubuntu-22.04
2020-06-01 15:36:59 -05:00
strategy:
matrix:
2022-02-19 08:15:15 -06:00
lua: [lua54, lua53, lua52, lua51, luajit, luau]
steps:
2022-09-12 17:29:05 -05:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
2022-09-12 17:29:05 -05:00
toolchain: nightly
components: clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
2022-04-17 11:29:51 -05:00
args: --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"