[ci] Ensure working directory is bin dir, otherwise the lib can't be … #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.github/workflows/x-*.yml' | |
workflow_dispatch: # manually-triggered runs | |
permissions: | |
# only allowed to read source code (ref. https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) | |
contents: read | |
concurrency: | |
# cancel pending runs when a PR gets updated | |
group: "${{ github.head_ref || github.run_id }}-${{ github.actor }}" | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: "CI - ${{ matrix.name }}" | |
strategy: | |
matrix: | |
include: | |
- name: "Ubuntu x64" | |
os: ubuntu-latest | |
env: | |
OS: "linux" | |
SCRIPT_SUFFIX: "linux_x64" | |
- name: "Ubuntu ARM64" | |
os: ubuntu-24.04-arm | |
env: | |
OS: "linux" | |
SCRIPT_SUFFIX: "linux_arm64" | |
- name: "macOS ARM64" | |
os: macos-15 | |
env: | |
OS: "macOS" | |
SCRIPT_SUFFIX: "macos_universal" | |
runs-on: "${{ matrix.os }}" | |
defaults: | |
run: | |
shell: "bash" | |
env: | |
DOTNET_NOLOGO: 1 | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.0.x' | |
- name: build C sample | |
run: | | |
cd Samples/Beyond.NET.Sample.C | |
./build_${{ matrix.env.SCRIPT_SUFFIX }} | |
# TODO: Verify that transform actually returns the expected result | |
- name: run C sample | |
run: | | |
cd "Samples/Beyond.NET.Sample.C/bin" | |
./transform 'abc123üiı' | |
- name: build Go sample (Linux) | |
if: "success() && matrix.env.OS == 'linux'" | |
run: | | |
cd Samples/Beyond.NET.Sample.Go | |
./build_${{ matrix.env.SCRIPT_SUFFIX }} | |
- name: run Swift tests (macOS) | |
if: "success() && matrix.env.OS == 'macOS'" | |
run: | | |
cd Samples/Beyond.NET.Sample.Swift | |
./build_dependencies | |
xcodebuild -workspace BeyondNETSamplesSwift.xcworkspace -scheme BeyondNETSampleSwift test -destination "name=My Mac" | |
xcodebuild -workspace BeyondNETSamplesSwift.xcworkspace -scheme BeyondNETSampleSwift test -destination "platform=iOS Simulator,name=iPhone 16,OS=18.0" | |
- name: build native sample | |
run: | | |
cd Samples/Beyond.NET.Sample.Native | |
./publish_${{ matrix.env.SCRIPT_SUFFIX }} | |
- name: build Android native | |
if: "success() && matrix.env.SCRIPT_SUFFIX != 'linux_arm64'" | |
run: | | |
cd Samples/Beyond.NET.Sample.Native | |
./publish_android_arm64 | |
#- name: run Android tests (macOS) | |
# if: "success() && matrix.env.OS == 'macOS'" | |
# uses: reactivecircus/android-emulator-runner@v2 | |
# with: | |
# api-level: 31 | |
# arch: arm64-v8a | |
# target: google_apis | |
# disable-animations: true | |
# force-avd-creation: false | |
# emulator-boot-timeout: 120 | |
# emulator-options: -no-audio -no-boot-anim -no-window -no-snapshot-save -gpu off -camera-back none | |
# working-directory: Samples/Beyond.NET.Sample.Android | |
# script: ./gradlew connectedAndroidTest | |
#- name: run Android tests (macOS) | |
# if: "success() && matrix.env.OS == 'macOS'" | |
# run: | | |
# cd Samples/Beyond.NET.Sample.Android | |
# ./test-on-emulator.ps1 |