ci: install xterm #4
This file contains hidden or 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
| # generated by o1 | |
| name: test | |
| on: | |
| - push | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 必要なパッケージのインストール | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xdotool xvfb xterm | |
| - name: Xvfbの起動 | |
| run: | | |
| export DISPLAY=:99 | |
| Xvfb :99 -screen 0 1024x768x16 & | |
| echo 'DISPLAY=:99' >> "$GITHUB_ENV" | |
| sleep 3 | |
| - name: geditの起動とテキストの入力 | |
| run: | | |
| # export DISPLAY=:99 | |
| # gedit & | |
| # # geditが起動するのを待機 | |
| # sleep 5 | |
| # # "Hello, World!"を入力 | |
| # xdotool type "Hello, World!" | |
| # # Ctrl+Sで保存ダイアログを開く | |
| # xdotool key ctrl+s | |
| # # 保存ダイアログが表示されるのを待機 | |
| # sleep 2 | |
| # # ファイル名を入力 | |
| # xdotool type "hello_world.txt" | |
| # # Enterキーで保存 | |
| # xdotool key Return | |
| # # geditを終了 | |
| # xdotool key ctrl+q | |
| export DISPLAY=:99 | |
| xterm & | |
| # xtermが起動するのを待機 | |
| sleep 3 | |
| # xtermのウィンドウIDを取得 | |
| WINDOW_ID=$(xdotool search --onlyvisible --class xterm | head -n1) | |
| # xtermにフォーカスを移す | |
| xdotool windowfocus $WINDOW_ID | |
| # コマンドを入力してファイルを作成 | |
| xdotool type --window $WINDOW_ID "echo 'Hello, World!' > hello_world.txt" | |
| xdotool key --window $WINDOW_ID Return | |
| # xtermを終了 | |
| xdotool type --window $WINDOW_ID "exit" | |
| xdotool key --window $WINDOW_ID Return | |
| - name: 保存されたファイルの内容を表示 | |
| run: cat hello_world.txt |