From 2e54bf9834e124f71dd3d1bbf8b5a4438e7bbf00 Mon Sep 17 00:00:00 2001 From: c-bata Date: Mon, 26 Oct 2020 15:58:39 +0900 Subject: [PATCH 1/3] Run tests and linters on GitHub Action --- .github/workflows/python-tests.yml | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/python-tests.yml diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml new file mode 100644 index 00000000..6090c0ae --- /dev/null +++ b/.github/workflows/python-tests.yml @@ -0,0 +1,36 @@ +name: Run tests and linters + + on: + pull_request: + paths: + - '.github/workflows/python-tests.yml' + - '**.py' + + jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + architecture: x64 + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + pip install --progress-bar off .[lint] + - run: flake8 . --show-source --statistics + - run: black --check . + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + architecture: x64 + - name: Install dependencies + run: pip install --progress-bar off . + - run: python setup.py test From 286c1516d39c9678235f42b2e8a178a6d44cfb4b Mon Sep 17 00:00:00 2001 From: c-bata Date: Mon, 26 Oct 2020 16:01:27 +0900 Subject: [PATCH 2/3] Fix action --- .github/workflows/python-tests.yml | 68 +++++++++++++++--------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 6090c0ae..0dbff5f0 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -1,36 +1,34 @@ name: Run tests and linters - - on: - pull_request: - paths: - - '.github/workflows/python-tests.yml' - - '**.py' - - jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - architecture: x64 - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - pip install --progress-bar off .[lint] - - run: flake8 . --show-source --statistics - - run: black --check . - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - architecture: x64 - - name: Install dependencies - run: pip install --progress-bar off . - - run: python setup.py test +on: + pull_request: + paths: + - '.github/workflows/python-tests.yml' + - '**.py' +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + architecture: x64 + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + pip install --progress-bar off .[lint] + - run: flake8 . --show-source + - run: black --check . + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + architecture: x64 + - name: Install dependencies + run: pip install --progress-bar off . + - run: python setup.py test From 315003f2451f1ec55ed410418becdb594e081530 Mon Sep 17 00:00:00 2001 From: c-bata Date: Mon, 26 Oct 2020 16:56:30 +0900 Subject: [PATCH 3/3] Add CI status badge --- .github/workflows/python-tests.yml | 4 +++- README.md | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 0dbff5f0..faeed100 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -1,6 +1,8 @@ -name: Run tests and linters +name: tests on: pull_request: + branches: + - main paths: - '.github/workflows/python-tests.yml' - '**.py' diff --git a/README.md b/README.md index 67b42266..a6d20670 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # optuna-dashboard +![tests](https://github.com/c-bata/optuna-dashboard/workflows/tests/badge.svg) + Real-time dashboard for [Optuna](https://github.com/optuna/optuna). Code files were originally taken from [Goptuna](https://github.com/c-bata/goptuna).