Update CI

This commit is contained in:
Alex Orlenko 2022-09-12 23:29:05 +01:00
parent 050ac4f5ad
commit 81a9998559
No known key found for this signature in database
GPG key ID: 4C150C250863B96D
2 changed files with 138 additions and 147 deletions

View file

@ -10,14 +10,14 @@ jobs:
options: --security-opt seccomp=unconfined options: --security-opt seccomp=unconfined
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Generate code coverage - name: Generate coverage report
run: | run: |
cargo tarpaulin --verbose --features lua54,vendored,async,send,serialize,macros --out xml --exclude-files benches --exclude-files build --exclude-files mlua_derive --exclude-files src/ffi --exclude-files tests cargo tarpaulin --verbose --features lua54,vendored,async,send,serialize,macros --out xml --exclude-files benches --exclude-files build --exclude-files mlua_derive --exclude-files src/ffi --exclude-files tests
- name: Upload to codecov.io - name: Upload report to codecov.io
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v3
with: with:
token: ${{secrets.CODECOV_TOKEN}} token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: false fail_ci_if_error: false

View file

@ -7,35 +7,34 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, macos-latest, windows-latest] os: [ubuntu-22.04, macos-latest, windows-latest]
rust: [stable] rust: [stable]
lua: [lua54, lua53, lua52, lua51, luajit, luau] lua: [lua54, lua53, lua52, lua51, luajit, luau]
include: include:
- os: ubuntu-20.04 - os: ubuntu-22.04
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
- os: macos-latest - os: macos-latest
target: x86_64-apple-darwin target: x86_64-apple-darwin
- os: windows-latest - os: windows-latest
target: x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }} target: ${{ matrix.target }}
override: true - uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@v1 - name: Build ${{ matrix.lua }} vendored
- name: Build ${{ matrix.lua }} vendored run: |
run: | cargo build --features "${{ matrix.lua }},vendored"
cargo build --features "${{ matrix.lua }},vendored" cargo build --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
cargo build --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot" shell: bash
shell: bash - name: Build ${{ matrix.lua }} pkg-config
- name: Build ${{ matrix.lua }} pkg-config if: ${{ matrix.os == 'ubuntu-22.04' }}
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.lua != 'lua54' }} run: |
run: | sudo apt-get update
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
sudo apt-get install -y --no-install-recommends liblua5.3-dev liblua5.2-dev liblua5.1-0-dev libluajit-5.1-dev cargo build --features "${{ matrix.lua }}"
cargo build --features "${{ matrix.lua }}"
build_aarch64_cross_macos: build_aarch64_cross_macos:
name: Cross-compile to aarch64-apple-darwin name: Cross-compile to aarch64-apple-darwin
@ -45,60 +44,57 @@ jobs:
matrix: matrix:
lua: [lua54, lua53, lua52, lua51, luajit] lua: [lua54, lua53, lua52, lua51, luajit]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: stable toolchain: stable
target: aarch64-apple-darwin target: aarch64-apple-darwin
override: true - name: Cross-compile
- name: Cross-compile run: cargo build --target aarch64-apple-darwin --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
run: cargo build --target aarch64-apple-darwin --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
build_aarch64_cross_ubuntu: build_aarch64_cross_ubuntu:
name: Cross-compile to aarch64-unknown-linux-gnu name: Cross-compile to aarch64-unknown-linux-gnu
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
needs: build needs: build
strategy: strategy:
matrix: matrix:
lua: [lua54, lua53, lua52, lua51, luajit] lua: [lua54, lua53, lua52, lua51, luajit]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: stable toolchain: stable
target: aarch64-unknown-linux-gnu target: aarch64-unknown-linux-gnu
override: true - name: Install ARM compiler toolchain
- name: Install ARM compiler toolchain run: |
run: | sudo apt-get update
sudo apt-get update sudo apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu libc6-dev-arm64-cross
sudo apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu libc6-dev-arm64-cross shell: bash
shell: bash - name: Cross-compile
- name: Cross-compile run: cargo build --target aarch64-unknown-linux-gnu --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
run: cargo build --target aarch64-unknown-linux-gnu --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot" shell: bash
shell: bash
build_armv7_cross_ubuntu: build_armv7_cross_ubuntu:
name: Cross-compile to armv7-unknown-linux-gnueabihf name: Cross-compile to armv7-unknown-linux-gnueabihf
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
needs: build needs: build
strategy: strategy:
matrix: matrix:
lua: [lua54, lua53, lua52, lua51] lua: [lua54, lua53, lua52, lua51]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: stable toolchain: stable
target: armv7-unknown-linux-gnueabihf target: armv7-unknown-linux-gnueabihf
override: true - name: Install ARM compiler toolchain
- name: Install ARM compiler toolchain run: |
run: | sudo apt-get update
sudo apt-get update sudo apt-get install -y --no-install-recommends gcc-arm-linux-gnueabihf libc-dev-armhf-cross
sudo apt-get install -y --no-install-recommends gcc-arm-linux-gnueabihf libc-dev-armhf-cross shell: bash
shell: bash - name: Cross-compile
- name: Cross-compile run: cargo build --target armv7-unknown-linux-gnueabihf --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
run: cargo build --target armv7-unknown-linux-gnueabihf --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot" shell: bash
shell: bash
test: test:
name: Test name: Test
@ -106,35 +102,34 @@ jobs:
needs: build needs: build
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, macos-latest, windows-latest] os: [ubuntu-22.04, macos-latest, windows-latest]
rust: [stable, nightly] rust: [stable, nightly]
lua: [lua54, lua53, lua52, lua51, luajit, luajit52, luau] lua: [lua54, lua53, lua52, lua51, luajit, luajit52, luau]
include: include:
- os: ubuntu-20.04 - os: ubuntu-22.04
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
- os: macos-latest - os: macos-latest
target: x86_64-apple-darwin target: x86_64-apple-darwin
- os: windows-latest - os: windows-latest
target: x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }} target: ${{ matrix.target }}
override: true - uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v1 - name: Run ${{ matrix.lua }} tests
- name: Run ${{ matrix.lua }} tests run: |
run: | cargo test --features "${{ matrix.lua }},vendored"
cargo test --features "${{ matrix.lua }},vendored" cargo test --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot"
cargo test --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot" shell: bash
shell: bash - name: Run compile tests (macos lua54)
- name: Run compile tests (macos lua54) if: ${{ matrix.os == 'macos-latest' && matrix.lua == 'lua54' }}
if: ${{ matrix.os == 'macos-latest' && matrix.lua == 'lua54' }} run: |
run: | TRYBUILD=overwrite cargo test --features "${{ matrix.lua }},vendored" -- --ignored
TRYBUILD=overwrite cargo test --features "${{ matrix.lua }},vendored" -- --ignored TRYBUILD=overwrite cargo test --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot" -- --ignored
TRYBUILD=overwrite cargo test --features "${{ matrix.lua }},vendored,async,send,serialize,macros,parking_lot" -- --ignored shell: bash
shell: bash
test_with_sanitizer: test_with_sanitizer:
name: Test with address sanitizer name: Test with address sanitizer
@ -142,25 +137,24 @@ jobs:
needs: build needs: build
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04] os: [ubuntu-22.04]
rust: [nightly] rust: [nightly]
lua: [lua54, lua53, lua52, lua51, luajit, luau] lua: [lua54, lua53, lua52, lua51, luajit, luau]
include: include:
- os: ubuntu-20.04 - os: ubuntu-22.04
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }} target: ${{ matrix.target }}
override: true - uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v1 - name: Run ${{ matrix.lua }} tests with address sanitizer
- name: Run ${{ matrix.lua }} tests with address sanitizer run: |
run: | RUSTFLAGS="-Z sanitizer=address" \
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
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
shell: bash
test_modules: test_modules:
name: Test modules name: Test modules
@ -168,27 +162,26 @@ jobs:
needs: build needs: build
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, macos-latest] os: [ubuntu-22.04, macos-latest]
rust: [stable] rust: [stable]
lua: [lua54, lua53, lua52, lua51, luajit] lua: [lua54, lua53, lua52, lua51, luajit]
include: include:
- os: ubuntu-20.04 - os: ubuntu-22.04
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
- os: macos-latest - os: macos-latest
target: x86_64-apple-darwin target: x86_64-apple-darwin
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }} target: ${{ matrix.target }}
override: true - uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v1 - name: Run ${{ matrix.lua }} module tests
- name: Run ${{ matrix.lua }} module tests run: |
run: | (cd tests/module && cargo build --release --features "${{ matrix.lua }}")
(cd tests/module && cargo build --release --features "${{ matrix.lua }}") (cd tests/module/loader && cargo test --release --features "${{ matrix.lua }},vendored")
(cd tests/module/loader && cargo test --release --features "${{ matrix.lua }},vendored") shell: bash
shell: bash
test_modules_windows: test_modules_windows:
name: Test modules on Windows name: Test modules on Windows
@ -201,41 +194,39 @@ jobs:
run: run:
shell: msys2 {0} shell: msys2 {0}
steps: steps:
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Install Rust & Lua - name: Install Rust & Lua
run: | 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 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 - name: Run ${{ matrix.lua }} module tests
run: | run: |
(cd tests/module && cargo build --release --features "${{ matrix.lua }}") (cd tests/module && cargo build --release --features "${{ matrix.lua }}")
(cd tests/module/loader && cargo test --release --features "${{ matrix.lua }}") (cd tests/module/loader && cargo test --release --features "${{ matrix.lua }}")
rustfmt: rustfmt:
name: Rustfmt name: Rustfmt
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: stable toolchain: stable
components: rustfmt components: rustfmt
override: true - run: cargo fmt -- --check
- run: cargo fmt -- --check
clippy: clippy:
name: Clippy check name: Clippy check
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
lua: [lua54, lua53, lua52, lua51, luajit, luau] lua: [lua54, lua53, lua52, lua51, luajit, luau]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: nightly toolchain: nightly
components: clippy components: clippy
override: true
- uses: actions-rs/clippy-check@v1 - uses: actions-rs/clippy-check@v1
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}