diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..b0f2777 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,36 @@ +name: Lint + +on: + push: + paths: + - '*.py' + - '!**.md' + pull_request: + branches: + - master + paths: + - '*.py' + - '!**.md' + release: + types: + - released + +jobs: + flake8_py3: + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: 3.7.4 + architecture: x64 + - name: Checkout PyTorch + uses: actions/checkout@master + - name: Install flake8 + run: pip install flake8 + - name: Run flake8 + uses: suo/flake8-github-action@releases/v1 + with: + checkName: 'flake8_py3' # NOTE: this needs to be the same as the job name + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8d5cec..9a5aafc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,19 +1,14 @@ name: Build on: - push: + workflow_run: + workflows: ["Lint"] + types: [completed] branches: - master paths-ignore: - '**.md' - pull_request: - branches: - - master - paths-ignore: - - '**.md' - release: - types: - - released + jobs: main: @@ -105,8 +100,6 @@ jobs: pytest tests/test_util.py pytest tests/test_xarray_netcdf_provider.py pytest tests/test_xarray_zarr_provider.py - - name: run flake8 ⚙️ - run: find . -type f -name "*.py" | xargs flake8 - name: build docs 🏗️ run: cd docs && make html - name: failed tests 🚩