-
Notifications
You must be signed in to change notification settings - Fork 6
74 lines (60 loc) · 2.2 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Builds and tests noteable-notebook-magics
name: noteable-notebook-magics Build
# Trigger the workflow on all pull requests and only pushes to the main branch
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
branches:
- main
- feature/*
jobs:
# Runs the build for the noteable-notebook-magics project
build:
runs-on: ubuntu-20.04
strategy:
# By default, GitHub will maximize the number of jobs run in parallel
# depending on the available runners on GitHub-hosted virtual machines.
# max-parallel: 8
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
outputs:
DEPLOY_TAG: ${{ steps.build-args.outputs.SHA_TAG || steps.build-args.outputs.BRANCH_TAG }}
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Install poetry
shell: bash
run: curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.5.1 python3 -
- name: Set up Python ${{ matrix.python-version }}
id: setup_python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install dependencies
shell: bash
run: poetry install
- name: Install CockroachDB
uses: ./.github/actions/setup-cockroachdb
# Run all of the tests
- name: Flake8 - Style guide enforcement
run: poetry run flake8 noteable/ tests/ --count --show-source --statistics --benchmark
- name: Black - Format check
run: poetry run black --diff noteable/ tests/
- name: Isort - Import format check
run: poetry run isort --diff --check noteable/ tests/
- name: Safety - Python dependency vulnerability check
run: poetry export --without-hashes -f requirements.txt | poetry run safety check --stdin -i 51457 -i 51668
- name: Set env
id: vars
run: PY_VER=${{ matrix.python-version }}; echo ::set-output name=tox_py::${PY_VER//.}
- name: Install tox for running tests with
run: pip install tox
- name: Pytest - Unit tests
run: tox -e py${{ steps.vars.outputs.tox_py }}