Skip to content

Commit dceddcf

Browse files
Add GitHub Actions workflows for CI/CD (#2)
* Initial plan * Add GitHub Action workflows for CI/CD Co-authored-by: BrandonLWhite <2344027+BrandonLWhite@users.noreply.github.com> * Fix trailing spaces in workflow files Co-authored-by: BrandonLWhite <2344027+BrandonLWhite@users.noreply.github.com> * Fix major version extraction to support versions >= 10 Co-authored-by: BrandonLWhite <2344027+BrandonLWhite@users.noreply.github.com> * Use string comparison for node-version condition Co-authored-by: BrandonLWhite <2344027+BrandonLWhite@users.noreply.github.com> * Add explicit permissions blocks to workflows for security Co-authored-by: BrandonLWhite <2344027+BrandonLWhite@users.noreply.github.com> * chore: update dependencies and add ESLint configuration - Added ESLint and TypeScript ESLint as devDependencies in package.json. - Updated test files to remove unused imports and adjust CoverageFile type usage. - Created a new ESLint configuration file to enforce coding standards and rules. * npm run build * Remove coverage upload step from CI workflow * Remove check for uncommitted changes after build step * fix: use outcome instead of conclusion in check-dist workflow * Remove dangling dist files * fix: make check-dist more robust against whitespace/filemode differences * refactor: remove uploader type definitions and source maps - Deleted the uploader.d.ts and uploader.d.ts.map files as they are no longer needed. - Updated the build script in package.json to use --transpile-only for faster builds. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BrandonLWhite <2344027+BrandonLWhite@users.noreply.github.com> Co-authored-by: BrandonLWhite <brandonlwhite@gmail.com>
1 parent f042a7c commit dceddcf

26 files changed

+1395
-81
lines changed

.github/dependabot.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for npm
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
open-pull-requests-limit: 10
9+
groups:
10+
dependencies:
11+
patterns:
12+
- "*"
13+
update-types:
14+
- "minor"
15+
- "patch"
16+
labels:
17+
- "dependencies"
18+
- "automated"
19+
20+
# Enable version updates for GitHub Actions
21+
- package-ecosystem: "github-actions"
22+
directory: "/"
23+
schedule:
24+
interval: "weekly"
25+
open-pull-requests-limit: 5
26+
labels:
27+
- "dependencies"
28+
- "github-actions"
29+
- "automated"

.github/workflows/check-dist.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Check Dist
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
check-dist:
13+
name: Check dist/
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Rebuild the dist/ directory
32+
run: npm run build
33+
34+
- name: Compare the expected and actual dist/ directories
35+
id: diff
36+
run: |
37+
# Ignore file mode and line ending differences
38+
git config core.fileMode false
39+
if [ "$(git diff --ignore-space-at-eol --ignore-cr-at-eol --ignore-blank-lines dist/ | wc -l)" -gt "0" ]; then
40+
echo "Detected uncommitted changes after build. See status below:"
41+
git diff --ignore-space-at-eol --ignore-cr-at-eol dist/
42+
exit 1
43+
fi
44+
45+
- name: Upload dist artifact for inspection
46+
if: failure() && steps.diff.outcome == 'failure'
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: dist
50+
path: dist/

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
name: Test
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
18+
strategy:
19+
matrix:
20+
node-version: [18, 20]
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
cache: 'npm'
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Run tests
36+
run: npm test
37+
38+
lint:
39+
name: Lint
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: read
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Setup Node.js
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: 20
52+
cache: 'npm'
53+
54+
- name: Install dependencies
55+
run: npm ci
56+
57+
- name: Run linter
58+
run: npm run lint
59+
60+
build:
61+
name: Build
62+
runs-on: ubuntu-latest
63+
permissions:
64+
contents: read
65+
66+
steps:
67+
- name: Checkout code
68+
uses: actions/checkout@v4
69+
70+
- name: Setup Node.js
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: 20
74+
cache: 'npm'
75+
76+
- name: Install dependencies
77+
run: npm ci
78+
79+
- name: Build
80+
run: npm run build

.github/workflows/codeql.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '0 0 * * 1' # Weekly on Monday at midnight UTC
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: ['javascript']
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v3
33+
with:
34+
languages: ${{ matrix.language }}
35+
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v3
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v3
41+
with:
42+
category: "/language:${{matrix.language}}"

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
update-tags:
9+
name: Update Release Tags
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Update major version tag
21+
run: |
22+
git config user.name github-actions
23+
git config user.email github-actions@github.com
24+
25+
TAG="${GITHUB_REF#refs/tags/}"
26+
if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
27+
MAJOR_VERSION=$(echo "$TAG" | cut -d. -f1)
28+
MAJOR_TAG="$MAJOR_VERSION"
29+
30+
echo "Creating/updating tag $MAJOR_TAG to point to $TAG"
31+
git tag -fa "$MAJOR_TAG" -m "Update $MAJOR_TAG tag to $TAG"
32+
git push origin "$MAJOR_TAG" --force
33+
else
34+
echo "Tag $TAG does not match semantic versioning format (v*.*.*)."
35+
fi

dist/ci-info.d.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

dist/ci-info.d.ts.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/file-finder.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/file-finder.d.ts.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/git-info.d.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)