Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize Action #296

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintignore
@@ -0,0 +1,4 @@
coverage/
dist/
node_modules/
*.json
40 changes: 40 additions & 0 deletions .eslintrc.yml
@@ -0,0 +1,40 @@
env:
es2022: true
node: true
jest: true

globals:
Atomics: readonly
SharedArrayBuffer: readonly

ignorePatterns:
- coverage/.*
- dist/.*
- node_modules/.*

parser: '@typescript-eslint/parser'

parserOptions:
ecmaVersion: 2022
project:
- tsconfig.eslint.json

plugins:
- '@typescript-eslint'

extends:
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
- plugin:@typescript-eslint/recommended
- eslint:recommended
- plugin:github/recommended
- plugin:import/typescript
- plugin:jest/recommended
- plugin:prettier/recommended

rules:
camelcase: 'off'
i18n-text/no-en: 'off'
import/no-namespace: 'off'
no-shadow: 'off'
no-unused-vars: 'off'
4 changes: 3 additions & 1 deletion .gitattributes
@@ -1 +1,3 @@
.licenses/** -diff linguist-generated=true
* text=auto eol=lf

dist/** -diff linguist-generated=true
26 changes: 26 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
actions-minor:
update-types:
- minor
- patch

- package-ecosystem: npm
directory: /
schedule:
interval: weekly
groups:
npm-development:
dependency-type: development
update-types:
- minor
- patch
npm-production:
dependency-type: production
update-types:
- patch
58 changes: 58 additions & 0 deletions .github/workflows/check-dist.yml
@@ -0,0 +1,58 @@
name: Check dist/

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'

permissions:
contents: read

jobs:
check-dist:
name: Check dist/
runs-on: ubuntu-latest

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

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm

- name: Install Dependencies
id: install
run: npm ci

- name: Build dist/ Directory
id: build
run: npm run bundle

- name: Compare Expected and Actual Directories
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text dist/
exit 1
fi

- if: ${{ failure() && steps.diff.conclusion == 'failure' }}
name: Upload Artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/codeql.yml
@@ -0,0 +1,47 @@
name: CodeQL

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '30 1 * * 4'

permissions:
actions: read
checks: write
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language:
- javascript

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

- name: Initialize CodeQL
id: initialize
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
id: autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v3
43 changes: 43 additions & 0 deletions .github/workflows/continuous-delivery.yml
@@ -0,0 +1,43 @@
name: Continuous Delivery

on:
pull_request:
types:
- closed
branches:
- main
workflow_dispatch:

permissions:
contents: write

jobs:
release:
name: Release Version
runs-on: ubuntu-latest

if: |
github.event_name == 'workflow_dispatch' ||
(github.event.pull_request.merged == true &&
startsWith(github.head_ref, 'dependabot/') == false)

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-tags: true

- name: Tag
id: tag
uses: issue-ops/[email protected]
with:
manifest-path: package.json
workspace: ${{ github.workspace }}
ref: main

- name: Create Release
id: release
uses: issue-ops/[email protected]
with:
tag: v${{ steps.tag.outputs.version }}
55 changes: 55 additions & 0 deletions .github/workflows/continuous-integration.yml
@@ -0,0 +1,55 @@
name: Continuous Integration

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
actions: read
checks: write
contents: read

jobs:
continuous-integration:
name: Continuous Integration
runs-on: ubuntu-latest

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

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm

- name: Install Dependencies
id: install
run: npm ci

- name: Check Format
id: format-check
run: npm run format:check

- name: Lint
id: lint
run: npm run lint

- name: Test
id: test
run: npm run ci-test

- name: Report Tests
id: report
uses: dorny/test-reporter@v1
with:
name: Test Report
path: reports/jest-*.xml
reporter: jest-junit