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

Cleanup #1

Merged
merged 14 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage/
dist/
node_modules/
*.json
40 changes: 40 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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/
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Continuous Integration

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

permissions:
contents: read

jobs:
test-typescript:
name: TypeScript Tests
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: npm-ci
run: npm ci

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

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

- name: Test
id: npm-ci-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

test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest

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

- name: Test Local Action
id: test-action
uses: ./
with:
milliseconds: 2000

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CodeQL

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

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

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

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
Original file line number Diff line number Diff line change
@@ -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 }}
Loading
Loading