codemp/.github/workflows/test.yml
2024-09-17 20:41:05 +02:00

98 lines
2.4 KiB
YAML

name: test
on:
push:
branches:
- dev
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-latest
- windows-latest
- macos-latest
features:
- rust
- java
- js
- py
toolchain:
- stable
- beta
- nightly
steps:
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo build --release --verbose --features=${{ matrix.features }}
# TODO to build lua bindings on macos, we need to tweak the compile command to expose symbols
# since i can't add conditional steps to above task, i have to separate off lua from the rest...
build-lua:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-latest
action: build
extra:
- runner: windows-latest
action: build
extra:
- runner: macos-latest
action: rustc
extra: -- -C link-arg=-undefined -C link-arg=dynamic_lookup
features:
- luajit
- lua54
toolchain:
- stable
- beta
- nightly
steps:
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo ${{ matrix.platform.action }} --release --verbose --features=${{ matrix.features }} ${{ matrix.platform.extra }}
test:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-latest
- windows-latest
- macos-latest
toolchain:
- stable
- beta
- nightly
steps:
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo test --verbose