diff --git a/.github/workflows/python-linter.yml b/.github/workflows/python-linter.yml index da72df6fc..f4f129074 100644 --- a/.github/workflows/python-linter.yml +++ b/.github/workflows/python-linter.yml @@ -4,12 +4,6 @@ name: '🔎 Python Linter' on: - push: - branches: - - 'master' - paths: - - 'scripts/libraries/*.py' - pull_request: types: - opened @@ -18,11 +12,11 @@ on: branches: - 'master' paths: + - 'scripts/examples/*.py' - 'scripts/libraries/*.py' jobs: build: - runs-on: ubuntu-latest strategy: fail-fast: false @@ -36,13 +30,14 @@ jobs: - name: '🐍 Set up Python ${{ matrix.python-version }}' uses: actions/setup-python@v4 with: + cache: 'pip' python-version: ${{ matrix.python-version }} - name: '🛠 Install dependencies' run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -r requirements.txt + flake8 --version + pytest --version - name: '😾 Lint with flake8' run: | diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt new file mode 100644 index 000000000..28ecacab6 --- /dev/null +++ b/.github/workflows/requirements.txt @@ -0,0 +1,2 @@ +flake8 +pytest