ci: "fix" tests

i dont know how to do this with just one task: basically when building
lua feature on mac i need to change the build command. so i split off
the lua build task. its annoying but ehh
This commit is contained in:
əlemi 2024-09-17 20:28:59 +02:00
parent 90618ddd1b
commit d963da6583
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 41 additions and 31 deletions

View file

@ -3,6 +3,7 @@ name: lua
on: on:
push: push:
branches: branches:
- dev
- stable - stable
permissions: permissions:
@ -20,59 +21,36 @@ jobs:
target: linux-gnu target: linux-gnu
pre: lib pre: lib
ext: so ext: so
buildcmd: cargo build --release --features=luajit
- runner: windows-latest - runner: windows-latest
arch: x86_64 arch: x86_64
target: windows-msvc target: windows-msvc
pre: pre:
ext: dll ext: dll
steps: buildcmd: cargo build --release --features=luajit
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: cargo build --release --features=luajit
- run: mv target/release/${{matrix.platform.pre}}codemp.${{matrix.platform.ext}} dist/lua/codemp-lua-${{matrix.platform.arch}}-${{matrix.platform.target}}.${{matrix.platform.ext}}
- uses: actions/upload-artifact@v4
with:
name: codemp-lua-${{ matrix.platform.target }}
path: dist/lua/codemp-lua-${{matrix.platform.arch}}-${{matrix.platform.target}}.${{matrix.platform.ext}}
# macos requires some extra cargo config to make it work, but
# these settings make test fail so better limit them to this run
build-macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: macos-latest - runner: macos-latest
arch: aarch64 arch: aarch64
target: darwin target: darwin
pre: lib pre: lib
ext: dylib ext: dylib
#- runner: macos-12 buildcmd: cargo rustc --release --features=luajit -- -C link-arg=-undefined -C link-arg=dynamic_lookup
# arch: x86_64
# platform: darwin
# pre: lib
# ext: dylib
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: cargo rustc --release --features=luajit -- -C link-arg=-undefined -C link-arg=dynamic_lookup - run: ${{ matrix.platform.buildcmd }}
- run: mv target/release/${{matrix.platform.pre}}codemp.${{matrix.platform.ext}} dist/lua/codemp-lua-${{matrix.platform.arch}}-${{matrix.platform.target}}.${{matrix.platform.ext}} - run: mv target/release/${{matrix.platform.pre}}codemp.${{matrix.platform.ext}} dist/lua/codemp-lua-${{matrix.platform.arch}}-${{matrix.platform.target}}.${{matrix.platform.ext}}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: codemp-lua-${{ matrix.platform.target }} name: codemp-lua-${{ matrix.platform.target }}
path: dist/lua/codemp-lua-${{matrix.platform.arch}}-${{matrix.platform.target}}.${{matrix.platform.ext}} path: dist/lua/codemp-lua-${{matrix.platform.arch}}-${{matrix.platform.target}}.${{matrix.platform.ext}}
# TODO this just copies files on our server, maybe publish on luarocks? maybe do it properly with versions # TODO this just copies files on our server, maybe consider other ways to distribute? maybe do it properly with versions?
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build, build-macos] needs: [build]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: mkdir dist/lua/publish - run: mkdir dist/lua/publish

View file

@ -23,8 +23,6 @@ jobs:
- macos-latest - macos-latest
features: features:
- rust - rust
- luajit
- lua54
- java - java
- js - js
- py - py
@ -42,6 +40,40 @@ jobs:
toolchain: ${{ matrix.toolchain }} toolchain: ${{ matrix.toolchain }}
- run: cargo build --release --verbose --features=${{ matrix.features }} - 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
buildcmd: build
extra:
- runner: macos-latest
buildcmd: 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: test:
runs-on: ${{ matrix.runner }} runs-on: ${{ matrix.runner }}
strategy: strategy: