Skip to content

Commit d904ad0

Browse files
committed
ci: add CICD pipeline
1 parent 4242b96 commit d904ad0

File tree

6 files changed

+190
-0
lines changed

6 files changed

+190
-0
lines changed

.github/FUNDING.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# These are supported funding model platforms
2+
3+
github: [char0n]
4+
tidelift: npm/@swaggerexpert%2Fjson-pointer
5+
patreon: char0n
6+
ko_fi: char0n
7+
liberapay: char0n
8+
issuehunt: char0n
9+

.github/dependabot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm"
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+
commit-message:
13+
prefix: "chore"
14+
include: "scope"
15+
16+
17+
- package-ecosystem: "github-actions"
18+
directory: "/"
19+
schedule:
20+
interval: "daily"
21+
commit-message:
22+
prefix: "chore"
23+
include: "scope"

.github/workflows/codeql.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "main" ]
20+
schedule:
21+
- cron: '33 18 * * 5'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# 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
53+
# queries: security-extended,security-and-quality
54+
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v3
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
65+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66+
67+
# - run: |
68+
# echo "Run, Build Application using script"
69+
# ./location_of_script_within_repo/buildscript.sh
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v3
73+
with:
74+
category: "/language:${{matrix.language}}"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Dependabot Merge Me!
2+
3+
on:
4+
pull_request_target:
5+
branches: [ main ]
6+
7+
jobs:
8+
merge-me:
9+
name: Merge me!
10+
if: github.actor == 'dependabot[bot]'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Merge me!
14+
uses: ahmadnassri/action-dependabot-auto-merge@v2
15+
with:
16+
target: minor
17+
github-token: ${{ secrets.DEPENDABOT_TOKEN }}
18+
command: squash and merge

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
name: Release
3+
on:
4+
workflow_dispatch:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20.5.0
21+
- name: Install dependencies
22+
run: npm ci
23+
- name: Execute tests
24+
run: npm test
25+
- name: Semantic Release
26+
id: semantic
27+
uses: cycjimmy/semantic-release-action@v4
28+
with:
29+
dry_run: false
30+
extra_plugins: |
31+
@semantic-release/git
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
- name: Release published
36+
if: steps.semantic.outputs.new_release_published == 'true'
37+
run: |
38+
echo ${{ steps.semantic.outputs.new_release_version }}
39+
echo ${{ steps.semantic.outputs.new_release_major_version }}
40+
echo ${{ steps.semantic.outputs.new_release_minor_version }}
41+
echo ${{ steps.semantic.outputs.new_release_patch_version }}

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Test
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: [ main ]
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Use Node.js 20.5.0
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20.5.0
22+
- name: Install dependencies
23+
run: npm ci
24+
- name: Execute tests
25+
run: npm test

0 commit comments

Comments
 (0)