Skip to content

Commit 75e7018

Browse files
authored
CI: Add workflow for CLI testing (qmk#7357)
Create GitHub Actions cli test workflow and remove travis runs of 'qmk pytest'
1 parent 8fe29f2 commit 75e7018

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

.github/workflows/cli.yml

+28
Original file line numberDiff line numberDiff line change
@@ -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

lib/python/qmk/tests/test_cli_commands.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_kle2json():
3030

3131

3232
def test_doctor():
33-
result = check_subcommand('doctor')
33+
result = check_subcommand('doctor', '-n')
3434
assert result.returncode == 0
3535
assert 'QMK Doctor is checking your environment.' in result.stderr
3636
assert 'QMK is ready to go' in result.stderr

util/travis_test.sh

-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
source util/travis_utils.sh
44

55
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)')
76

87
if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then
98
echo "Skipping due to commit message"
@@ -19,10 +18,4 @@ if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_CORE_CHANGES" != "0" ]; then
1918

2019
fi
2120

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-
2821
exit $exit_code

0 commit comments

Comments
 (0)