adds a security analysis pipeline and improves build pipeline (#45)
* adds a security pipeline, updates pipeline triggers * prevent pipeline from running twice, if PR is open
This commit is contained in:
parent
b6dab1c038
commit
799d7bd1f0
|
|
@ -0,0 +1,63 @@
|
||||||
|
# Sets up CodeQL Analysis
|
||||||
|
# Security analysis from GitHub for C, C++, C#, Go, Java, JavaScript, TypeScript, Python, and Ruby developers.
|
||||||
|
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
schedule:
|
||||||
|
- cron: '29 7 * * 1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'javascript' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||||
|
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
||||||
|
|
@ -5,30 +5,42 @@ name: Node.js CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches:
|
||||||
|
- '**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches:
|
||||||
|
- main
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [14.x, 16.x, 17.x]
|
node-version: [14.x, 16.x]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout repository
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
uses: actions/checkout@v2
|
||||||
uses: actions/setup-node@v2
|
|
||||||
with:
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
node-version: ${{ matrix.node-version }}
|
uses: actions/setup-node@v2
|
||||||
- name: Install system dependencies
|
with:
|
||||||
run: |
|
node-version: ${{ matrix.node-version }}
|
||||||
sudo apt -qq update
|
|
||||||
sudo apt install -y bluetooth bluez libbluetooth-dev libudev-dev
|
- name: Install dependencies
|
||||||
- run: npm ci
|
run: |
|
||||||
- run: npm run build --if-present
|
sudo apt -qq update
|
||||||
- run: npm run lint
|
sudo apt install -y bluetooth bluez libbluetooth-dev libudev-dev
|
||||||
- run: npm test
|
npm ci
|
||||||
|
|
||||||
|
- name: Build application
|
||||||
|
run: npm run build --if-present
|
||||||
|
|
||||||
|
- name: Static code analysis
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Run test suite
|
||||||
|
run: npm test
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue