From 75e7018f72a716ca2809e337d524966c7c4137a8 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 8 Feb 2020 12:43:55 +0000 Subject: [PATCH] CI: Add workflow for CLI testing (#7357) Create GitHub Actions cli test workflow and remove travis runs of 'qmk pytest' --- .github/workflows/cli.yml | 28 +++++++++++++++++++++++ lib/python/qmk/tests/test_cli_commands.py | 2 +- util/travis_test.sh | 7 ------ 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/cli.yml diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml new file mode 100644 index 000000000..275581273 --- /dev/null +++ b/.github/workflows/cli.yml @@ -0,0 +1,28 @@ +name: CLI CI + +on: + push: + branches: + - master + - future + pull_request: + paths: + - 'lib/python/**' + - 'bin/qmk' + - 'requirements.txt' + - '.github/workflows/cli.yml' + +jobs: + test: + runs-on: ubuntu-latest + + container: qmkfm/base_container + + steps: + - uses: actions/checkout@v1 + with: + submodules: recursive + - name: Install dependencies + run: pip3 install -r requirements.txt + - name: Run tests + run: bin/qmk pytest diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py index 3f75cef3e..f1a92d9a3 100644 --- a/lib/python/qmk/tests/test_cli_commands.py +++ b/lib/python/qmk/tests/test_cli_commands.py @@ -30,7 +30,7 @@ def test_kle2json(): def test_doctor(): - result = check_subcommand('doctor') + result = check_subcommand('doctor', '-n') assert result.returncode == 0 assert 'QMK Doctor is checking your environment.' in result.stderr assert 'QMK is ready to go' in result.stderr diff --git a/util/travis_test.sh b/util/travis_test.sh index 95991907e..c6fc0f903 100644 --- a/util/travis_test.sh +++ b/util/travis_test.sh @@ -3,7 +3,6 @@ source util/travis_utils.sh NUM_CORE_CHANGES=$(echo "$QMK_CHANGES" | grep -Ecv -e '^(docs/)' -e '^(keyboards/)' -e '^(layouts/)' -e '^(util/)' -e '^(lib/python/)' -e '^(bin/qmk)' -e '^(requirements.txt)' -e '(.travis.yml)') -NUM_PY_CHANGES=$(echo "$QMK_CHANGES" | grep -Ec -e '^(lib/python/)' -e '^(bin/qmk)') if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then echo "Skipping due to commit message" @@ -19,10 +18,4 @@ if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_CORE_CHANGES" != "0" ]; then fi -if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_PY_CHANGES" != "0" ]; then - echo "Running python tests." - qmk pytest - : $((exit_code = $exit_code + $?)) -fi - exit $exit_code