Skip to content

Commit

Permalink
Add github workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
azurepolarbear committed Nov 3, 2024
1 parent 733bda6 commit 6bac5c3
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: weekly
target-branch: "development-main"
allow:
- dependency-type: "direct"
versioning-strategy: increase
commit-message:
prefix: "dependabot npm update"
include: "scope"
groups:
development-dependencies:
applies-to: version-updates
dependency-type: "development"
update-types:
- "major"
- "minor"
- "patch"
development-dependencies-security:
applies-to: security-updates
dependency-type: "development"
update-types:
- "major"
- "minor"
- "patch"
production-dependencies:
applies-to: version-updates
dependency-type: "production"
update-types:
- "major"
- "minor"
- "patch"
production-dependencies-security:
applies-to: security-updates
dependency-type: "production"
update-types:
- "major"
- "minor"
- "patch"
reviewers:
- "blwatkins"
- "azurepolarbear"

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
target-branch: "development-main"
commit-message:
prefix: "dependabot github-action update"
include: "scope"
reviewers:
- "blwatkins"
- "azurepolarbear"
74 changes: 74 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "CodeQL"

on:
push:
branches:
- "main"
- "development-main"
pull_request:
branches:
- "main"
- "development-main"
schedule:
- cron: '0 12 * * *'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript-typescript' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
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.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
36 changes: 36 additions & 0 deletions .github/workflows/node-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js Build

on:
push:
branches:
- "main"
- "development-main"
pull_request:
branches:
- "main"
- "development-main"

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 18.x, 20.x, 22.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run prod-build
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"lint": "eslint ./src",
"deploy": "webpack --mode production",
"prod-build": "webpack --mode production",
"build": "webpack --mode development",
"start": "webpack-dev-server --mode development",
"stats": "webpack --mode development --profile --json > ./out/stats.json"
Expand Down

0 comments on commit 6bac5c3

Please sign in to comment.