diff options
-rw-r--r-- | .github/workflows/cli.yml | 28 | ||||
-rw-r--r-- | lib/python/qmk/tests/test_cli_commands.py | 2 | ||||
-rw-r--r-- | util/travis_test.sh | 7 |
3 files changed, 29 insertions, 8 deletions
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 @@ | |||
1 | name: CLI CI | ||
2 | |||
3 | on: | ||
4 | push: | ||
5 | branches: | ||
6 | - master | ||
7 | - future | ||
8 | pull_request: | ||
9 | paths: | ||
10 | - 'lib/python/**' | ||
11 | - 'bin/qmk' | ||
12 | - 'requirements.txt' | ||
13 | - '.github/workflows/cli.yml' | ||
14 | |||
15 | jobs: | ||
16 | test: | ||
17 | runs-on: ubuntu-latest | ||
18 | |||
19 | container: qmkfm/base_container | ||
20 | |||
21 | steps: | ||
22 | - uses: actions/checkout@v1 | ||
23 | with: | ||
24 | submodules: recursive | ||
25 | - name: Install dependencies | ||
26 | run: pip3 install -r requirements.txt | ||
27 | - name: Run tests | ||
28 | 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(): | |||
30 | 30 | ||
31 | 31 | ||
32 | def test_doctor(): | 32 | def test_doctor(): |
33 | result = check_subcommand('doctor') | 33 | result = check_subcommand('doctor', '-n') |
34 | assert result.returncode == 0 | 34 | assert result.returncode == 0 |
35 | assert 'QMK Doctor is checking your environment.' in result.stderr | 35 | assert 'QMK Doctor is checking your environment.' in result.stderr |
36 | assert 'QMK is ready to go' in result.stderr | 36 | 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 @@ | |||
3 | source util/travis_utils.sh | 3 | source util/travis_utils.sh |
4 | 4 | ||
5 | 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)') | 5 | 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)') |
6 | NUM_PY_CHANGES=$(echo "$QMK_CHANGES" | grep -Ec -e '^(lib/python/)' -e '^(bin/qmk)') | ||
7 | 6 | ||
8 | if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then | 7 | if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then |
9 | echo "Skipping due to commit message" | 8 | echo "Skipping due to commit message" |
@@ -19,10 +18,4 @@ if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_CORE_CHANGES" != "0" ]; then | |||
19 | 18 | ||
20 | fi | 19 | fi |
21 | 20 | ||
22 | if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_PY_CHANGES" != "0" ]; then | ||
23 | echo "Running python tests." | ||
24 | qmk pytest | ||
25 | : $((exit_code = $exit_code + $?)) | ||
26 | fi | ||
27 | |||
28 | exit $exit_code | 21 | exit $exit_code |