GitAuto: マニュアル操作時のキーコンフィグ作成検討 #88
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: | |
# push, pullrequest時にci実行 | |
push: | |
paths-ignore: | |
- '.gitignore' | |
- 'LICENSE' | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '.gitignore' | |
- 'LICENSE' | |
- '**.md' | |
# 環境変数 | |
env: | |
DISPLAY: ':99' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.6] # [3.5, 3.6, 3.7, 3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
sudo apt-get install -y python3-pip | |
pip3 install --upgrade pip | |
pip3 install numpy | |
pip3 install PyQt5 | |
sudo apt-get install -y python3-pyqt5 | |
sudo apt-get install -y git | |
sudo apt-get install -y jq | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
# xvfbのインストールと起動 | |
- name: Xvfb install and run | |
run: | | |
sudo apt-get install -y xvfb | |
Xvfb -ac ${{ env.DISPLAY }} -screen 0 1280x780x24 & | |
- name: tetris_game | |
# tetris_gameが動くかどうか確認(SCOREが入ればOK) | |
run: | | |
git clone https://github.com/seigot/tetris_game | |
cd tetris_game | |
bash start.sh -s y -t 3 -f $HOME/result.json | |
# check result | |
jq . $HOME/result.json | |
SCORE=`jq ."judge_info"."score" $HOME/result.json` | |
echo "SCORE: $SCORE" | |
if [ $SCORE -lt 0 ]; then echo "error";exit 1; fi |