Skip to content

Commit

Permalink
add pipeline steps for scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
SmnHgr committed Feb 9, 2024
1 parent d661b18 commit 8430d82
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/scanner-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Scanner Build Stage

on:
push:
pull_request:

defaults:
run:
working-directory: ./scanner

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci --prefer-offline

- name: Build
run: npm run build
env:
CI: true
4 changes: 4 additions & 0 deletions .github/workflows/scanner-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

name: Create and publish a Docker image for the scanner

defaults:
run:
working-directory: ./scanner

on:
push:
branches:
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/scanner-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Scanner Test Stage

on:
# push:
# pull_request:
workflow_run:
workflows:
- Scanner Build Stage
types:
- completed

defaults:
run:
working-directory: ./scanner

jobs:
lint:
# if: jobs.build.result == 'success'
runs-on: ubuntu-latest
# needs: build
# uses: ./.github/workflows/scanner-build.yml
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "18"

- name: Install dependencies
run: npm ci --prefer-offline

- name: Lint
run: npm run test:lint

type-check:
# if: jobs.build.result == 'success'
runs-on: ubuntu-latest
# needs: build
# uses: ./.github/workflows/scanner-build.yml
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm ci --prefer-offline

- name: Type check
run: npm run test:typecheck

unit-test:
# if: jobs.build.result == 'success'
runs-on: ubuntu-latest
# needs: build
# uses: ./.github/workflows/scanner-build.yml
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm ci --prefer-offline

- name: Unit test
run: npm run test:unittest
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: coverage/cobertura-coverage.xml


0 comments on commit 8430d82

Please sign in to comment.