-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update ci-build.yml * Delete setup.py * Delete requirements.txt * Delete build.py * Delete build-requirements.txt * Update README.md * Update pyproject.toml Drop coverage requirement to 45% as project only has this amount of coverage for now. * Fix non-printable character U+00A0 Fix python invalid non-printable character U+00A0 * Fix nonprintable characters, add poetry.lock
- Loading branch information
Showing
11 changed files
with
2,358 additions
and
269 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ on: [push, pull_request] | |
|
||
jobs: | ||
lint: | ||
name: Lint with flake8 | ||
name: Lint Code | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -14,17 +14,38 @@ jobs: | |
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-01-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pybuilder | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Run pybuilder w/o unit tests | ||
run: | | ||
pyb analyze | ||
- name: Install Lava | ||
run: poetry install --no-interaction | ||
|
||
- name: Run flakeheaven (flake8) | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: | | ||
source $VENV | ||
flakeheaven lint src/lava tests/ | ||
- name: Run flakeheaven (flake8) | ||
if: runner.os == 'Windows' | ||
run: | | ||
.venv\Scripts\activate.ps1 | ||
flakeheaven lint src/lava tests/ | ||
security-lint: | ||
name: Security Lint with bandit | ||
name: Security Lint Code | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -35,17 +56,35 @@ jobs: | |
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-01-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pybuilder | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Run pybuilder to lint security w/ bandit | ||
run: | | ||
pyb bandit | ||
- name: Install Lava | ||
run: poetry install --no-interaction | ||
|
||
- name: Run bandit | ||
uses: tj-actions/[email protected] | ||
with: | ||
targets: | | ||
src/lava/. | ||
options: "-r --format custom --msg-template '{abspath}:{line}: {test_id}[bandit]: {severity}: {msg}'" | ||
|
||
unit-tests: | ||
name: Run unit tests | ||
name: Unit Test Code + Coverage | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
|
@@ -59,12 +98,34 @@ jobs: | |
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-01-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pybuilder | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Install Lava | ||
run: poetry install --no-interaction | ||
|
||
- name: Run unit tests | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: | | ||
source $VENV | ||
pytest | ||
- name: Run unit tests | ||
if: runner.os == 'Windows' | ||
run: | | ||
pyb -E unit | ||
.venv\Scripts\activate.ps1 | ||
pytest |
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 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 file was deleted.
Oops, something went wrong.
Oops, something went wrong.