Update deps #116
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 is a basic workflow to help you get started with Actions | |
name: Cloud Composer Diff CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for changes to the cloudcomposerdiff directory | |
push: | |
branches: ["main"] | |
paths: ["cloudcomposerdiff/**"] | |
pull_request: | |
branches: ["main"] | |
paths: ["cloudcomposerdiff/**"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: "blacken and lint" | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- uses: psf/black@stable | |
with: | |
options: "--check --verbose" | |
src: "./cloudcomposerdiff" | |
# adapted from GitHub docs for building and testing Python | |
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
# and strategies used in Python samples | |
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/noxfile-template.py | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 flake8-import-order flake8-annotations | |
- name: Lint with flake8 | |
run: | | |
flake8 cloudcomposerdiff/ --show-source --builtin=gettext --max-complexity=29 --import-order-style=pep8 --ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202 --max-line-length=88 | |
test: | |
name: "run pytest" | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
# adapted from GitHub docs for building and testing Python | |
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
# and strategies used in Python samples | |
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/noxfile-template.py | |
- name: Install dependencies | |
# install pytest, module dependencies and tool itself | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
pip install -r cloudcomposerdiff/requirements.txt | |
pip install cloudcomposerdiff/ | |
- name: Test with pytest | |
run: | | |
pytest cloudcomposerdiff/ |