Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cutoffthetop committed Dec 22, 2023
1 parent a4c97f5 commit ce5232c
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 107 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/cve-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CVE Scan

on:
pull_request:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:

jobs:
scan:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Cache trivy
uses: actions/cache@v3
env:
cache-name: cache-trivy
with:
path: ~/.cache/trivy
key: ${{ env.cache-name }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ env.cache-name }}-
- name: Run trivy
uses: aquasecurity/trivy-action@master
with:
exit-code: 1
format: 'sarif'
output: 'trivy-results.sarif'
scan-ref: '.'
scan-type: 'fs'
severity: 'CRITICAL,HIGH'
list-all-pkgs: 'true'
ignore-unfixed: true

- name: Publish results
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'
106 changes: 0 additions & 106 deletions .github/workflows/default.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Linting

on:
push:
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ env.cache-name }}-
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install requirements
run: make install

- name: Run linters
run: make linter
52 changes: 52 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Testing

on:
push:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ env.cache-name }}-
- name: Cache poetry
uses: actions/cache@v3
env:
cache-name: cache-poetry
with:
path: ~/.cache/pip
key: ${{ env.cache-name }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ env.cache-name }}-
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install project
run: npm install

- name: Run tests
run: npm run test

- name: Publish report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '*/TESTS.xml'
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce5232c

Please sign in to comment.