Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable macOS release #94

Merged
merged 4 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 9 additions & 31 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ concurrency:

jobs:
test-x86:
name: Test (x86-64)
runs-on: ubuntu-latest
name: Test
strategy:
matrix:
runner:
- ubuntu-latest
- [runs-on, runner=8cpu-linux-arm64, "run-id=${{ github.run_id }}"]
- macos-latest
- macos-13
runs-on: ${{ matrix.runner }}
timeout-minutes: 10
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
Expand Down Expand Up @@ -53,35 +60,6 @@ jobs:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
RUST_BACKTRACE: 1

# test-arm:
# name: Test (ARM)
# runs-on: runs-on,runner=64cpu-linux-arm64,spot=false
# env:
# CARGO_NET_GIT_FETCH_WITH_CLI: "true"
# steps:
# - name: Checkout sources
# uses: actions/checkout@v4

# - name: Setup CI
# uses: ./.github/actions/setup

# - name: Run cargo check
# uses: actions-rs/cargo@v1
# with:
# command: check
# toolchain: nightly-2024-04-17
# args: --all-targets --all-features

# - name: Run cargo test
# uses: actions-rs/cargo@v1
# with:
# command: test
# toolchain: nightly-2024-04-17
# args: --release
# env:
# RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
# RUST_BACKTRACE: 1

test-go:
name: Test (Go)
runs-on: ubuntu-latest
Expand Down
37 changes: 19 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ jobs:
svm_target_platform: linux-amd64
platform: linux
arch: amd64
# - runner: warp-ubuntu-latest-arm64-4x
# target: aarch64-unknown-linux-gnu
# svm_target_platform: linux-aarch64
# platform: linux
# arch: arm64
# - runner: macos-latest-large
# target: x86_64-apple-darwin
# svm_target_platform: macosx-amd64
# platform: darwin
# arch: amd64
# - runner: macos-latest-xlarge
# target: aarch64-apple-darwin
# svm_target_platform: macosx-aarch64
# platform: darwin
# arch: arm64
- runner: [runs-on, runner=8cpu-linux-arm64, "run-id=${{ github.run_id }}"]
target: aarch64-unknown-linux-gnu
svm_target_platform: linux-aarch64
platform: linux
arch: arm64
- runner: macos-latest
target: aarch64-apple-darwin
svm_target_platform: macosx-aarch64
platform: darwin
arch: arm64
- runner: macos-13
target: x86_64-apple-darwin
svm_target_platform: macosx-amd64
platform: darwin
arch: amd64
# - runner: windows-latest
# target: x86_64-pc-windows-msvc
# svm_target_platform: windows-amd64
Expand Down Expand Up @@ -187,17 +187,18 @@ jobs:
elif [ "$PLATFORM_NAME" == "darwin" ]; then
# We need to use gtar here otherwise the archive is corrupt.
# See: https://github.com/actions/virtual-environments/issues/2619
# TODO: add vmlib
gtar -czvf "cargo_athena_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release cargo-athena
echo "file_name_1=cargo_athena_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
gtar -czvf "athena_vmlib_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release libathena_vmlib.dylib
gtar -czvf "athena_vmlib_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" \
-C $GITHUB_WORKSPACE/target/${TARGET}/release libathena_vmlib.dylib \
-C $GITHUB_WORKSPACE/ffi/athcon include
echo "file_name_2=athena_vmlib_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
else
# TODO: add vmlib
cd ./target/${TARGET}/release
7z a -tzip "cargo_athena_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" cargo-athena.exe
mv "cargo_athena_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../
echo "file_name_1=cargo_athena_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT
# TODO: add athcon headers
7z a -tzip "athena_vmlib_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" libathena_vmlib.dll
mv "athena_vmlib_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../
echo "file_name_2=athena_vmlib_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT
Expand Down
8 changes: 4 additions & 4 deletions ffi/vmlib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ pub unsafe fn vm_tests(vm_ptr: *mut ffi::athcon_vm) {
assert_eq!(
vm.set_option.unwrap()(
vm_ptr,
"foo\0".as_ptr() as *const i8,
"bar\0".as_ptr() as *const i8
"foo\0".as_ptr() as *const std::os::raw::c_char,
"bar\0".as_ptr() as *const std::os::raw::c_char
),
ffi::athcon_set_option_result::ATHCON_SET_OPTION_INVALID_NAME
);
Expand Down Expand Up @@ -654,8 +654,8 @@ pub unsafe fn vm_tests(vm_ptr: *mut ffi::athcon_vm) {
assert_eq!(
wrapper.base.set_option.unwrap()(
vm_ptr,
"foo\0".as_ptr() as *const i8,
"bar\0".as_ptr() as *const i8
"foo\0".as_ptr() as *const std::os::raw::c_char,
"bar\0".as_ptr() as *const std::os::raw::c_char
),
ffi::athcon_set_option_result::ATHCON_SET_OPTION_INVALID_NAME
);
Expand Down
Loading