mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 07:14:50 +01:00
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:
parent
90618ddd1b
commit
d963da6583
2 changed files with 41 additions and 31 deletions
36
.github/workflows/lua.yml
vendored
36
.github/workflows/lua.yml
vendored
|
@ -3,6 +3,7 @@ name: lua
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- stable
|
||||
|
||||
permissions:
|
||||
|
@ -20,59 +21,36 @@ jobs:
|
|||
target: linux-gnu
|
||||
pre: lib
|
||||
ext: so
|
||||
buildcmd: cargo build --release --features=luajit
|
||||
- runner: windows-latest
|
||||
arch: x86_64
|
||||
target: windows-msvc
|
||||
pre:
|
||||
ext: dll
|
||||
steps:
|
||||
- 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:
|
||||
buildcmd: cargo build --release --features=luajit
|
||||
- runner: macos-latest
|
||||
arch: aarch64
|
||||
target: darwin
|
||||
pre: lib
|
||||
ext: dylib
|
||||
#- runner: macos-12
|
||||
# arch: x86_64
|
||||
# platform: darwin
|
||||
# pre: lib
|
||||
# ext: dylib
|
||||
buildcmd: cargo rustc --release --features=luajit -- -C link-arg=-undefined -C link-arg=dynamic_lookup
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
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}}
|
||||
- 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}}
|
||||
|
||||
# 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:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, build-macos]
|
||||
needs: [build]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: mkdir dist/lua/publish
|
||||
|
|
36
.github/workflows/test.yml
vendored
36
.github/workflows/test.yml
vendored
|
@ -23,8 +23,6 @@ jobs:
|
|||
- macos-latest
|
||||
features:
|
||||
- rust
|
||||
- luajit
|
||||
- lua54
|
||||
- java
|
||||
- js
|
||||
- py
|
||||
|
@ -42,6 +40,40 @@ jobs:
|
|||
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
|
||||
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:
|
||||
runs-on: ${{ matrix.runner }}
|
||||
strategy:
|
||||
|
|
Loading…
Reference in a new issue