Skip to content

fix a bug that empty strings are removed from args on Windows #74

fix a bug that empty strings are removed from args on Windows

fix a bug that empty strings are removed from args on Windows #74

Workflow file for this run

name: test
on:
pull_request:
branches:
- main
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 codespell
cpplint --recursive --quiet .
codespell -S subprojects
test:
strategy:
fail-fast: false
matrix:
os: [windows-2022, ubuntu-20.04, macos-11]
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: install gtk for linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -y install libgtk-3-dev
- name: build and run tests for Windows
if: runner.os == 'Windows'
run: |
cd batch_files
./test.bat
# need xvfb for gui test
- name: build and run tests for Linux
if: runner.os == 'Linux'
run: |
sudo apt-get -y install xvfb at-spi2-core
xvfb-run bash shell_scripts/test.sh
# 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_alpine:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Run tests on alpine
run: |
docker build -t tuw_alpine_test -f docker/alpine.dockerfile ./
docker run --rm --init -i tuw_alpine_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
mkdir workspace/exe_container
cp build/ReleaseARM-Test/tests/exe_container/exe_container.exe workspace/exe_container
mkdir workspace/json_check
cp build/ReleaseARM-Test/tests/json_check/json_check.exe workspace/json_check
cp tests/json_check/*.json workspace/json_check
mkdir workspace/main_frame
cp build/ReleaseARM-Test/tests/main_frame/main_frame.exe workspace/main_frame
cp tests/main_frame/*.json workspace/main_frame
cp examples/all_keys/gui_definition.json workspace
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/exe_container/exe_container.exe /workspace/gui_definition.json'
docker run --rm --init -i -v $(pwd)/workspace/:/workspace docker.io/linaro/wine-arm64 xvfb-run wine-arm64 cmd.exe /c '/workspace/json_check/json_check.exe /workspace/json_check/broken.json /workspace/gui_definition.json'
docker run --rm --init -i -v $(pwd)/workspace/:/workspace docker.io/linaro/wine-arm64 xvfb-run wine-arm64 cmd.exe /c '/workspace/main_frame/main_frame.exe /workspace/gui_definition.json /workspace/main_frame/config_ascii.json /workspace/main_frame/config_utf.json'