This repository has been archived by the owner on Oct 13, 2024. It is now read-only.
chore: update global workflows #1049
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# This action is centrally managed in https://github.com/<organization>/.github/ | |
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | |
# the above-mentioned repo. | |
# Lint python files with flake8. | |
name: flake8 | |
on: | |
pull_request: | |
branches: [master] | |
types: [opened, synchronize, reopened] | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
flake8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 # https://github.com/actions/setup-python | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade \ | |
pip \ | |
setuptools \ | |
wheel \ | |
flake8 \ | |
nb-clean \ | |
nbqa[toolchain] | |
- name: Test with flake8 | |
run: | | |
python -m flake8 \ | |
--color=always \ | |
--verbose | |
- name: Test with nbqa | |
run: | | |
python -m nbqa flake8 \ | |
--color=always \ | |
--verbose \ | |
. | |
- name: Test with nb-clean | |
run: | | |
output=$(find . -name '*.ipynb' -exec nb-clean check {} \;) | |
# fail if there are any issues | |
if [ -n "$output" ]; then | |
echo "$output" | |
exit 1 | |
fi |