mirror of
https://github.com/mozilla/DeepSpeech.git
synced 2025-10-26 11:19:39 +00:00
Merge pull request #3604 from lissyx/circleci-to-githubactions
Fix #3602: Linter on GitHub Actions
This commit is contained in:
commit
153997f5e2
@ -72,30 +72,6 @@ jobs:
|
||||
docker push "${DOCKERHUB_REPO}:${CIRCLE_TAG}"
|
||||
fi
|
||||
|
||||
lint:
|
||||
docker:
|
||||
- image: circleci/python:3.7.9
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: |
|
||||
pip install --upgrade cardboardlint pylint
|
||||
- run:
|
||||
name: Run linter
|
||||
command: |
|
||||
set -ex
|
||||
# Check if branch can be merged with master (if failing script will stop due to set -e)
|
||||
git config user.email "you@example.com"
|
||||
git config user.name "Your Name"
|
||||
git merge --no-commit --no-ff origin/master
|
||||
|
||||
# Undo merge changes if any
|
||||
git reset --hard $CIRCLE_BRANCH
|
||||
|
||||
# Lint differences against master
|
||||
cardboardlinter --refspec origin/master -n auto;
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build-deploy:
|
||||
@ -111,7 +87,3 @@ workflows:
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
|
||||
lint:
|
||||
jobs:
|
||||
- lint
|
||||
|
||||
33
.github/workflows/lint.yml
vendored
Normal file
33
.github/workflows/lint.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: "Python linter"
|
||||
on:
|
||||
pull_request:
|
||||
jobs:
|
||||
lint:
|
||||
name: "Running cardboardlinter"
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: python:3.9.4-slim-buster
|
||||
steps:
|
||||
# https://github.com/actions/checkout/issues/175#issuecomment-595410280
|
||||
- run: |
|
||||
apt-get -qq -y update
|
||||
apt-get -qq -y install git
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- run: |
|
||||
pip install --upgrade cardboardlint pylint
|
||||
- run: |
|
||||
set -ex
|
||||
# Check if branch can be merged with master (if failing script will stop due to set -e)
|
||||
git config user.email "you@example.com"
|
||||
git config user.name "Your Name"
|
||||
git merge --no-commit --no-ff origin/${{ github.base_ref }}
|
||||
- run: |
|
||||
set -ex
|
||||
# Undo merge changes if any
|
||||
git reset --hard ${{ github.sha }}
|
||||
- run: |
|
||||
set -ex
|
||||
# Lint differences against master
|
||||
cardboardlinter --refspec origin/${{ github.base_ref }} -n auto;
|
||||
Loading…
Reference in New Issue
Block a user