Skip to content

Commit

Permalink
ci:split checks into py & go jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Jan 30, 2020
1 parent cf257f9 commit 605c4af
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@ stages:
jobs:
include:
# patch formatting checks
- name: "Check patch formatting"
- name: "Python formatting"
stage: check
os: linux
language: python
python: 3.7
before_install:
install:
script: ./scripts/ci/check_patch.sh
- name: "Script formatting"
os: linux
language: go
go: 1.13
before_install:
install:
script: ./scripts/ci/check_patch.sh
script: ./scripts/ci/check_scripts.sh
# test jobs
- name: "3.7 on Windows"
stage: test
Expand Down
9 changes: 6 additions & 3 deletions scripts/ci/check_patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
set -x
set -e

python3 -m pip install --user Pygments collective.checkdocs pre-commit
pip install Pygments collective.checkdocs pre-commit

# stop the build if there are any readme formatting errors
python3 setup.py checkdocs
python setup.py checkdocs

# stop the build if there are any formatting errors
GO111MODULE=on pre-commit run --all-files
err=0
pre-commit run --all-files black || err=1
pre-commit run --all-files flake8 || err=1
exit $err
7 changes: 7 additions & 0 deletions scripts/ci/check_scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -x
set -e

# stop the build if there are any formatting errors
GO111MODULE=on pre-commit run --all-files shfmt

0 comments on commit 605c4af

Please sign in to comment.