c7c5076ba0 #137
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
name: scrapers-cicd | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'scrapers/*/**' | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- 'scrapers/*/**' | |
jobs: | |
test_pyapps: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
architecture: "x64" | |
env: | |
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache | |
- name: Install Pipenv | |
run: | | |
python -m pip install pipenv | |
- name: Install requirements | |
run: | | |
pipenv install --dev --verbose | |
- name: Run tests | |
run: | | |
pipenv run python -m pytest tests/ -s | |
- name: Format-Lint-Sort | |
run: | | |
if [[ $(git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r ${{ github.sha }} -- '*.py' | xargs) ]]; then | |
pipenv run python -m black --check $(git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r "$GITHUB_SHA" -- '*.py' | xargs) | |
pipenv run python -m isort $(git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r "$GITHUB_SHA" -- '*.py' | xargs) | |
pipenv run python -m pylint $(git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r "$GITHUB_SHA" -- '*.py' | xargs) | |
fi |