Skip to content

Redirect stderr to console window #123

Redirect stderr to console window

Redirect stderr to console window #123

Workflow file for this run

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, ubuntu-20.04, 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: 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
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'