From 89750d0620b9810aace478b4acf1b535d7990577 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 5 May 2024 17:57:34 +0200 Subject: [PATCH] replace tests with github workflows --- .github/workflows/style.yml | 56 +++++++++++++++++++++++++++++++++++++ .travis.yml | 10 ------- check_pep8.sh | 8 ------ 3 files changed, 56 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/style.yml delete mode 100644 .travis.yml delete mode 100755 check_pep8.sh diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 00000000..8c0d256c --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,56 @@ +name: Code Style +on: [ push, pull_request ] + +jobs: + isort: + name: isort + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install Dependencies + run: pip3 install isort + - name: Run isort + run: 'isort --check --diff .' + black: + name: black + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install Dependencies + run: pip3 install black + - name: Run black + run: 'black --check --diff .' + pycodestyle1: + name: pycodestyle (everything but tests) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install Dependencies + run: pip3 install pycodestyle + - name: Run pycodestyle + run: 'pycodestyle --ignore=E402,E501,W503 --exclude=voctocore/tests,doc,example-scripts .' + pycodestyle2: + name: pycodestyle (tests only) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install Dependencies + run: pip3 install pycodestyle + - name: Run pycodestyle + run: 'pycodestyle --ignore=E501 voctocore/tests' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9b66d429..00000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: python -python: - - 3.5 - -before_install: - - pip install pycodestyle mock - -script: - - ./check_pep8.sh - - ./voctocore/test.sh diff --git a/check_pep8.sh b/check_pep8.sh deleted file mode 100755 index 3eb53572..00000000 --- a/check_pep8.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -e - -# ignore import-not-at-top (required by gi) -pycodestyle --ignore=E402 --exclude=voctocore/tests,doc,example-scripts . - -# ignore long lines (prefer explanatory test-names) -pycodestyle --ignore=E501 voctocore/tests