Skip to content

Commit

Permalink
CI: Add workflow for CLI testing (#7357)
Browse files Browse the repository at this point in the history
Create GitHub Actions cli test workflow and remove travis runs of 'qmk pytest'
  • Loading branch information
zvecr committed Feb 8, 2020
1 parent 8fe29f2 commit 75e7018
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion lib/python/qmk/tests/test_cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions util/travis_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

0 comments on commit 75e7018

Please sign in to comment.