Skip to content

Commit

Permalink
Union of backend and frontend scans in the same workflow and addition…
Browse files Browse the repository at this point in the history
… of Flake8 and isort scans for the backend
  • Loading branch information
pablosnt committed Dec 27, 2023
1 parent dab3d2b commit c1b4ccd
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 81 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/code-style-backend.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/code-style-frontend.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Code style
on:
workflow_dispatch:
pull_request:

jobs:
backend:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- tool: black
arguments: --check src/backend/
working_directory: .
- tool: isort
arguments: src/backend/ --check-only
working_directory: .
- tool: mypy
arguments: --namespace-packages --package backend --install-types --non-interactive
working_directory: ./src
- tool: flake8
arguments: --ignore=E501 src/backend
working_directory: .
name: ${{ matrix.tool }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Python dependencies
run: |
python -m pip install -U pip
python -m pip install -r src/backend/requirements-dev.txt
- uses: dorny/paths-filter@3c49e64ca26115121162fb767bc6af9e8d059f1a
id: changes
with:
filters: |
backend:
- 'src/backend/**'
- name: Check
working-directory: ${{ matrix.working_directory }}
if: ${{ steps.changes.outputs.backend == 'true' || github.event_name != 'pull_request' }}
run: ${{ matrix.tool }} ${{ matrix.arguments }}

frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install ESLint
working-directory: src/frontend
run: |
npm install .
npm install -g eslint
- uses: dorny/paths-filter@3c49e64ca26115121162fb767bc6af9e8d059f1a
id: changes
with:
filters: |
frontend:
- 'src/frontend/**'
- name: ESLint check
if: ${{ steps.changes.outputs.frontend == 'true' || github.event_name != 'pull_request' }}
run: eslint src/frontend/ --ext .js,.jsx,.ts,.tsx
17 changes: 17 additions & 0 deletions .github/workflows/security-ssc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Software Supply Chain
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
pull_request:

jobs:
legitify:
name: Legitify
runs-on: ubuntu-latest
environment: github
steps:
- name: Legitify
uses: Legit-Labs/legitify@d64d18810d9093458f11731c3a0a36d7e573187e
with:
github_token: ${{ secrets.ADMIN_PAT }}
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://github.com/pablosnt/rekono/actions/workflows/unit-testing.yml" alt="Unit testing" target="_blank">
<img src="https://github.com/pablosnt/rekono/actions/workflows/unit-testing.yml/badge.svg"/>
<a href="https://github.com/pablosnt/rekono/actions/workflows/unit-tests.yml" alt="Unit tests" target="_blank">
<img src="https://github.com/pablosnt/rekono/actions/workflows/unit-tests.yml/badge.svg"/>
</a>
<a href="https://github.com/pablosnt/rekono/actions/workflows/desktop-ui.yml" alt="Desktop UI" target="_blank">
<img src="https://github.com/pablosnt/rekono/actions/workflows/desktop-ui.yml/badge.svg"/>
Expand All @@ -11,9 +11,6 @@
<a href="https://snyk.io/test/github/pablosnt/rekono" alt="SCA" target="_blank">
<img src="https://badgen.net/snyk/pablosnt/rekono?label=SCA&labelColor=black&icon=https://snyk.io/wp-content/uploads/patch-white.svg">
</a>
<a href="https://github.com/pablosnt/rekono/actions/workflows/security-secrets.yml" alt="Secrets scanning" target="_blank">
<img src="https://github.com/pablosnt/rekono/actions/workflows/security-secrets.yml/badge.svg"/>
</a>
<a href="https://github.com/pablosnt/rekono/actions/workflows/security-containers.yml" alt="Containers" target="_blank">
<img src="https://github.com/pablosnt/rekono/actions/workflows/security-containers.yml/badge.svg"/>
</a>
Expand Down
5 changes: 0 additions & 5 deletions src/backend/.mypy.ini

This file was deleted.

2 changes: 2 additions & 0 deletions src/backend/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-r requirements.txt
black==23.12.1
coverage==7.3.4
flake8==6.1.0
isort==5.13.2
mypy==1.8.0

0 comments on commit c1b4ccd

Please # to comment.