|
1 | | -name: Test |
| 1 | +--- |
| 2 | +name: "Test" |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches: |
5 | | - - "master" |
| 6 | + - "!dependabot/*" |
| 7 | + - "*" |
6 | 8 | pull_request: |
7 | 9 | branches: |
8 | | - - "*" |
| 10 | + - "*" |
9 | 11 | jobs: |
10 | 12 | lint: |
11 | | - name: Format & Lint |
12 | | - runs-on: ubuntu-latest |
| 13 | + name: "Format & Lint" |
| 14 | + runs-on: "ubuntu-latest" |
13 | 15 | strategy: |
14 | 16 | fail-fast: false |
15 | 17 | steps: |
16 | | - |
17 | | - - uses: actions/checkout@v2 |
18 | | - - name: Set up Python 3.8 |
19 | | - uses: actions/setup-python@v1 |
20 | | - with: |
21 | | - python-version: 3.8 |
22 | | - - name: Setup Python Environment |
23 | | - run: pip install -U pip virtualenv |
24 | | - |
25 | | - - name: Install Dependencies |
26 | | - run: | |
27 | | - virtualenv ~/.cache/virtualenv/authzedpy |
28 | | - source ~/.cache/virtualenv/authzedpy/bin/activate |
29 | | - pip install poetry |
30 | | - poetry env info |
31 | | - poetry install |
32 | | - - name: Check for Lint |
33 | | - run: | |
34 | | - source ~/.cache/virtualenv/authzedpy/bin/activate |
35 | | - find . -name "*.py" | grep -v "_pb2" | xargs pyflakes |
36 | | - - name: Check Formatting |
37 | | - run: | |
38 | | - source ~/.cache/virtualenv/authzedpy/bin/activate |
39 | | - black --check --diff . |
40 | | - - name: Checking Imports Ordering |
41 | | - run: | |
42 | | - source ~/.cache/virtualenv/authzedpy/bin/activate |
43 | | - find . -name "*.py" | grep -v "_pb2" | xargs isort --check --diff |
| 18 | + - uses: "actions/checkout@v2" |
| 19 | + - uses: "bewuethr/yamllint-action@v1.1.1" |
| 20 | + with: |
| 21 | + config-file: ".yamllint" |
| 22 | + - uses: "actions/setup-python@v1" |
| 23 | + with: |
| 24 | + python-version: "3.8" |
| 25 | + - name: "Setup Python Environment" |
| 26 | + run: "pip install -U pip virtualenv" |
| 27 | + - name: "Install Dependencies" |
| 28 | + run: | |
| 29 | + virtualenv ~/.cache/virtualenv/authzedpy |
| 30 | + source ~/.cache/virtualenv/authzedpy/bin/activate |
| 31 | + pip install poetry |
| 32 | + poetry env info |
| 33 | + poetry install |
| 34 | + - name: "Pyflakes" |
| 35 | + run: | |
| 36 | + source ~/.cache/virtualenv/authzedpy/bin/activate |
| 37 | + find . -name "*.py" | grep -v "_pb2" | xargs pyflakes |
| 38 | + - name: "Blacken" |
| 39 | + run: | |
| 40 | + source ~/.cache/virtualenv/authzedpy/bin/activate |
| 41 | + black --check --diff . |
| 42 | + - name: "Isort" |
| 43 | + run: | |
| 44 | + source ~/.cache/virtualenv/authzedpy/bin/activate |
| 45 | + find . -name "*.py" | grep -v "_pb2" | xargs isort --check --diff |
44 | 46 |
|
45 | 47 | pytest: |
46 | | - name: Unit Tests |
47 | | - runs-on: ubuntu-latest |
| 48 | + name: "Unit Tests" |
| 49 | + runs-on: "ubuntu-latest" |
48 | 50 | strategy: |
49 | 51 | matrix: |
50 | | - python-version: [3.6, 3.7, 3.8, 3.9] |
| 52 | + python-version: |
| 53 | + - "3.6" |
| 54 | + - "3.7" |
| 55 | + - "3.8" |
| 56 | + - "3.9" |
51 | 57 | steps: |
52 | | - - uses: actions/checkout@v2 |
53 | | - - name: Set up Python ${{ matrix.python-version }} |
54 | | - uses: actions/setup-python@v2 |
55 | | - with: |
56 | | - python-version: ${{ matrix.python-version }} |
57 | | - - name: Setup Python Environment |
58 | | - run: pip install -U pip virtualenv |
59 | | - |
60 | | - - name: Install Dependencies |
61 | | - run: | |
62 | | - virtualenv ~/.cache/virtualenv/authzedpy |
63 | | - source ~/.cache/virtualenv/authzedpy/bin/activate |
64 | | - pip install poetry |
65 | | - poetry env info |
66 | | - poetry install |
67 | | - - name: Pytest |
68 | | - run: | |
69 | | - source ~/.cache/virtualenv/authzedpy/bin/activate |
70 | | - pytest -vv . |
| 58 | + - uses: "actions/checkout@v2" |
| 59 | + - uses: "actions/setup-python@v2" |
| 60 | + with: |
| 61 | + python-version: "${{ matrix.python-version }}" |
| 62 | + - name: "Setup Python Environment" |
| 63 | + run: "pip install -U pip virtualenv" |
| 64 | + - name: "Install Dependencies" |
| 65 | + run: | |
| 66 | + virtualenv ~/.cache/virtualenv/authzedpy |
| 67 | + source ~/.cache/virtualenv/authzedpy/bin/activate |
| 68 | + pip install poetry |
| 69 | + poetry env info |
| 70 | + poetry install |
| 71 | + - name: "Pytest" |
| 72 | + run: | |
| 73 | + source ~/.cache/virtualenv/authzedpy/bin/activate |
| 74 | + pytest -vv . |
71 | 75 |
|
72 | 76 | protobuf: |
73 | | - name: Generate & Diff |
74 | | - runs-on: ubuntu-latest |
| 77 | + name: "Generate & Diff" |
| 78 | + runs-on: "ubuntu-latest" |
75 | 79 | steps: |
76 | | - - uses: actions/checkout@v2 |
77 | | - - name: Set up Python 3.6 |
78 | | - uses: actions/setup-python@v1 |
79 | | - with: |
80 | | - python-version: 3.6 |
81 | | - - name: Setup Python Environment |
82 | | - run: pip install -U pip virtualenv |
83 | | - - name: Install Homebrew & gRPC |
84 | | - run: | |
85 | | - bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
86 | | - brew install grpc |
87 | | - - uses: bufbuild/buf-setup-action@v0.1.0 |
88 | | - with: |
89 | | - version: '0.43.2' |
90 | | - |
91 | | - - name: Install Python Dependencies |
92 | | - run: | |
93 | | - virtualenv ~/.cache/virtualenv/authzedpy |
94 | | - source ~/.cache/virtualenv/authzedpy/bin/activate |
95 | | - pip install poetry |
96 | | - poetry env info |
97 | | - poetry install |
98 | | -
|
99 | | - - name: Generate & Diff Protos |
100 | | - run: | |
101 | | - source ~/.cache/virtualenv/authzedpy/bin/activate |
102 | | - ./buf.gen.yaml |
103 | | - bash -c '[ $(git status --porcelain | tee /dev/fd/2 | wc -c) -eq 0 ]' |
| 80 | + - uses: "actions/checkout@v2" |
| 81 | + - uses: "actions/setup-python@v1" |
| 82 | + with: |
| 83 | + python-version: "3.6" |
| 84 | + - name: "Setup Python Environment" |
| 85 | + run: "pip install -U pip virtualenv" |
| 86 | + - name: "Install Homebrew & gRPC" |
| 87 | + run: | |
| 88 | + bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| 89 | + brew install grpc |
| 90 | + - uses: "bufbuild/buf-setup-action@v0.5.0" |
| 91 | + with: |
| 92 | + version: "0.56.0" |
| 93 | + - name: "Install Python Dependencies" |
| 94 | + run: | |
| 95 | + virtualenv ~/.cache/virtualenv/authzedpy |
| 96 | + source ~/.cache/virtualenv/authzedpy/bin/activate |
| 97 | + pip install poetry |
| 98 | + poetry env info |
| 99 | + poetry install |
| 100 | + - name: "Generate & Diff Protos" |
| 101 | + run: | |
| 102 | + source ~/.cache/virtualenv/authzedpy/bin/activate |
| 103 | + ./buf.gen.yaml && git diff && bash -c '[ $(git status --porcelain | tee /dev/fd/2 | wc -c) -eq 0 ]' |
0 commit comments