| 1 |
name: Code-Quality |
| 2 |
|
| 3 |
on: [pull_request, workflow_dispatch] |
| 4 |
|
| 5 |
jobs: |
| 6 |
lint: |
| 7 |
runs-on: ubuntu-latest |
| 8 |
|
| 9 |
steps: |
| 10 |
- name: "checkout repository" |
| 11 |
uses: actions/checkout@v3 |
| 12 |
|
| 13 |
- name: "set up python" |
| 14 |
uses: actions/setup-python@v2 |
| 15 |
with: |
| 16 |
python-version: "3.10" |
| 17 |
|
| 18 |
- name: "install poetry" |
| 19 |
run: | |
| 20 |
curl -sSL https://install.python-poetry.org | python3 - --version 1.3.2 |
| 21 |
|
| 22 |
- name: "cache dependencies" |
| 23 |
uses: actions/cache@v2 |
| 24 |
with: |
| 25 |
path: ~/.cache/pypoetry/virtualenvs |
| 26 |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }} |
| 27 |
restore-keys: ${{ runner.os }}-poetry- |
| 28 |
|
| 29 |
- name: "install dependencies" |
| 30 |
run: poetry install |
| 31 |
|
| 32 |
- name: "run syntax check" |
| 33 |
run: | |
| 34 |
./bin/syntax.sh |
| 35 |
|
| 36 |
test: |
| 37 |
runs-on: ubuntu-latest |
| 38 |
|
| 39 |
steps: |
| 40 |
- name: "checkout repository" |
| 41 |
uses: actions/checkout@v3 |
| 42 |
|
| 43 |
- name: "set up python" |
| 44 |
uses: actions/setup-python@v2 |
| 45 |
with: |
| 46 |
python-version: "3.10" |
| 47 |
|
| 48 |
- name: "install poetry" |
| 49 |
run: | |
| 50 |
curl -sSL https://install.python-poetry.org | python3 - --version 1.3.2 |
| 51 |
|
| 52 |
- name: "cache dependencies" |
| 53 |
uses: actions/cache@v2 |
| 54 |
with: |
| 55 |
path: ~/.cache/pypoetry/virtualenvs |
| 56 |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }} |
| 57 |
restore-keys: ${{ runner.os }}-poetry- |
| 58 |
|
| 59 |
- name: "install dependencies" |
| 60 |
run: poetry install |
| 61 |
|
| 62 |
- name: "set python path" |
| 63 |
run: echo "PYTHONPATH=.:baler" >> $GITHUB_ENV |
| 64 |
|
| 65 |
- name: "run tests" |
| 66 |
run: | |
| 67 |
./bin/tests.sh |