From 35ed9bfbbc6430306ab9419a7593b20686752133 Mon Sep 17 00:00:00 2001 From: Yuta Hayashibe Date: Sat, 28 Oct 2023 00:26:46 +0900 Subject: [PATCH 1/4] Add black test --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ Makefile | 17 +++++++++++++++++ requirements_dev.txt | 1 + 3 files changed, 51 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 Makefile create mode 100644 requirements_dev.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..243e265c5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +--- +name: CI +"on": push + +jobs: + ci: + strategy: + matrix: + python-version: ["3.11"] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Create venv + run: | + python3 -m venv .venv + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements_dev.txt') }} + + - run: .venv/bin/pip install -r ./requirements_dev.txt + + - run: | + . .venv/bin/activate + make test diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..614c213ff --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +.PHONY: all +all: + +.PHONY: style +style: + black --exclude venv --exclude .venv . + +.PHONY: test_style +test_style: + find . -type d \( -name venv -o -name .venv \) -prune -o -type f -name "*.py" -print | xargs black --diff | diff /dev/null - + +.PHONY: test +test: test_style + + +.DELETE_ON_ERROR: +SHELL=/bin/bash diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 000000000..05306aa58 --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1 @@ +black==23.10.1 From ecb6477f29f6ad6981300323a459234743f42f51 Mon Sep 17 00:00:00 2001 From: Yuta Hayashibe Date: Sat, 28 Oct 2023 00:33:08 +0900 Subject: [PATCH 2/4] Add issue template --- .github/PULL_REQUEST_TEMPLATE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..c81170e42 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ + + From 2ac27e714d7df82bc6953b44fdd26ed70c49d790 Mon Sep 17 00:00:00 2001 From: Yuta Hayashibe Date: Sat, 28 Oct 2023 00:35:27 +0900 Subject: [PATCH 3/4] Add names --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 243e265c5..5b8cac7a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,10 @@ jobs: path: .venv key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements_dev.txt') }} - - run: .venv/bin/pip install -r ./requirements_dev.txt + - name: Install dependencies + run: .venv/bin/pip install -r ./requirements_dev.txt - - run: | + - name: Test + run: | . .venv/bin/activate make test From 2b30d0819db76a00ab3404700829235751fd082d Mon Sep 17 00:00:00 2001 From: Yuta Hayashibe Date: Sat, 28 Oct 2023 00:44:49 +0900 Subject: [PATCH 4/4] Add triggers --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b8cac7a8..fb3e520ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,12 @@ --- name: CI -"on": push +on: + push: + pull_request: + types: + - opened + - synchronize + - reopened jobs: ci: