fix an error when launching tuw as a macOS application #142
Workflow file for this run
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: test | |
on: | |
pull_request: | |
branches: | |
- main | |
- dev | |
workflow_dispatch: | |
env: | |
TOOL_NAME: Tuw | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- run: | | |
pip3 install cpplint==1.6.1 codespell | |
cpplint --recursive --quiet . | |
codespell -S subprojects | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2022, macos-14] | |
runs-on: ${{ matrix.os }} | |
needs: lint | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Meson for Windows | |
if: runner.os == 'Windows' | |
run: pip install meson | |
- name: Install Meson for Unix | |
if: runner.os != 'Windows' | |
run: pip3 install meson ninja | |
- name: Prepare MSVC | |
if: runner.os == 'Windows' | |
uses: bus1/cabuild/action/msdevshell@v1 | |
with: | |
architecture: x64 | |
- name: build and run tests for Windows | |
if: runner.os == 'Windows' | |
run: | | |
cd batch_files | |
./test.bat | |
# xquartz has xvfb functions | |
- name: build and run tests for mac | |
if: runner.os == 'macOS' | |
run: | | |
brew install --cask xquartz | |
bash shell_scripts/test.sh | |
test_linux_arm64: | |
runs-on: ubuntu-latest | |
needs: lint | |
strategy: | |
matrix: | |
os: [ubuntu, alpine] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests on arm64 image | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y qemu-user-static binfmt-support | |
docker buildx build --platform linux/arm64 -t tuw_arm_test -f docker/${{ matrix.os }}.dockerfile ./ | |
docker run --rm --init -i tuw_arm_test xvfb-run bash test.sh | |
test_linux_x64: | |
runs-on: ubuntu-latest | |
needs: lint | |
strategy: | |
matrix: | |
os: [ubuntu, alpine] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests on x64 image | |
run: | | |
docker build -t tuw_test -f docker/${{ matrix.os }}.dockerfile ./ | |
docker run --rm --init -i tuw_test xvfb-run bash test.sh | |
build_tests_windows_arm64: | |
runs-on: windows-2022 | |
needs: lint | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Meson | |
run: pip install meson | |
- name: Prepare MSVC | |
uses: bus1/cabuild/action/msdevshell@v1 | |
with: | |
architecture: x64 | |
- name: build tests | |
run: | | |
cd batch_files | |
./test_arm.bat | |
- name: copy test files to ./workspace | |
run: | | |
mkdir workspace | |
cp build/ReleaseARM-Test/tests/unit_test.exe workspace | |
mkdir workspace/json | |
cp build/ReleaseARM-Test/tests/json/*.json* workspace/json | |
shell: bash | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests-windows-arm64 | |
path: workspace | |
run_tests_windows_arm64: | |
runs-on: ubuntu-latest | |
needs: [lint, build_tests_windows_arm64] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: tests-windows-arm64 | |
path: workspace | |
- name: Run tests with wine-arm64 | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y qemu-user-static xvfb | |
docker run --rm --init -i -v $(pwd)/workspace/:/workspace docker.io/linaro/wine-arm64 xvfb-run wine-arm64 cmd.exe /c '/workspace/unit_test.exe' |