Skip to content

Commit

Permalink
chore(ci): a new start on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
csantiago132 committed Sep 30, 2024
0 parents commit 64e873b
Show file tree
Hide file tree
Showing 75 changed files with 14,738 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['./src/commitlint'],
};
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ['./src/eslint/eslint.node'],
overrides: [
{
files: ['src/**'],
rules: {
'sort-keys': 'error',
},
},
],
};
40 changes: 40 additions & 0 deletions .github/workflows/_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Setup Workflow

on:
workflow_call:
inputs:
node_version:
type: string
required: true

jobs:
setup:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_version}}

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies with pnpm
run: pnpm install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cache pnpm store
uses: actions/cache@v3
with:
path: ~/.pnpm-store # Path to pnpm store
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} # Cache key based on OS and lockfile hash
restore-keys: |
${{ runner.os }}-pnpm-
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI/CD Workflow

permissions:
pull-requests: write
contents: write
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: false

on:
pull_request:
push:
branches:
- main

jobs:
pipeline:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies with pnpm
run: pnpm install

- name: Run Commitlint
run: git log -1 --pretty=%B | pnpm exec commitlint

- name: Run ESLint
run: pnpm eslint . --max-warnings=0 # Use pnpm

- name: Run Prettier
run: pnpm prettier --check . # Use pnpm

- name: Run Semantic Release
if: github.ref == 'refs/heads/main'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release
78 changes: 78 additions & 0 deletions .github/workflows/ci_writerside_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build, Test, and Deploy Documentation

on:
push:
branches: ['main']
pull_request:
branches: ['main']
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

env:
INSTANCE: 'Writerside/dcs' # Name of the module (adjust for your project)
ARTIFACT: 'webHelpDCS2-all.zip' # Name of the artifact to be generated
DOCKER_VERSION: '242.21870' # Specific Docker version

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }} # Ensure access to private repo
fetch-depth: 0

- name: Build docs using Writerside Docker builder
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}

- name: Save artifact with build results
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }} # Artifact inside the artifacts folder
artifacts/report.json
retention-days: 7

- name: Unzip artifact
run: |
unzip -O UTF-8 -qq artifacts/${{ env.ARTIFACT }} -d dir
- name: Configure GitHub Pages
uses: actions/configure-pages@v4

- name: Upload artifact to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: dir

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

test:
runs-on: ubuntu-latest
needs: build-and-deploy

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: docs
path: artifacts

- name: Test documentation using Writerside Checker
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}
Empty file.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

.idea
.idea/
artifacts/
dir/
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
.nyc_output
coverage.*

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

.DS_Store

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules/

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

typings/
lib/*.js
test/*.js
*.map
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec lint-staged
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/styleguide.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
auto-install-peers = true
@@kurocado-studio:registry=https://www.npmjs.com/settings/kurocado-studio/packages
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock.json
pnpm-lock.yaml
1 change: 1 addition & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./src/semantic-release');
Empty file added CHANGELOG.md
Empty file.
Loading

0 comments on commit 64e873b

Please sign in to comment.