Skip to content

Commit 34ccecb

Browse files
committed
Move Away from Docker Based action to NodeJS based action (#5)
Based off of template from: https://github.com/actions/typescript-action
1 parent 5aac996 commit 34ccecb

35 files changed

+39376
-151
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
lib/
2+
dist/
3+
node_modules/
4+
coverage/
5+
.direnv/

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
3+
dist/** -diff linguist-generated=true

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
actions-minor:
9+
update-types:
10+
- minor
11+
- patch
12+
13+
- package-ecosystem: npm
14+
directory: /
15+
schedule:
16+
interval: weekly
17+
groups:
18+
npm-development:
19+
dependency-type: development
20+
update-types:
21+
- minor
22+
- patch
23+
npm-production:
24+
dependency-type: production
25+
update-types:
26+
- patch

.github/linters/.eslintrc.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
env:
2+
node: true
3+
es6: true
4+
jest: true
5+
6+
globals:
7+
Atomics: readonly
8+
SharedArrayBuffer: readonly
9+
NodeJS: true
10+
11+
ignorePatterns:
12+
- "!.*"
13+
- "**/node_modules/.*"
14+
- "**/dist/.*"
15+
- "**/coverage/.*"
16+
- "*.json"
17+
18+
parser: "@typescript-eslint/parser"
19+
20+
parserOptions:
21+
ecmaVersion: 2023
22+
sourceType: module
23+
project:
24+
- "./.github/linters/tsconfig.json"
25+
- "./tsconfig.json"
26+
27+
plugins:
28+
- jest
29+
- "@typescript-eslint"
30+
31+
extends:
32+
- eslint:recommended
33+
- plugin:@typescript-eslint/eslint-recommended
34+
- plugin:@typescript-eslint/recommended
35+
- plugin:github/recommended
36+
- plugin:jest/recommended
37+
38+
rules:
39+
{
40+
"camelcase": "off",
41+
"eslint-comments/no-use": "off",
42+
"eslint-comments/no-unused-disable": "off",
43+
"i18n-text/no-en": "off",
44+
"import/no-namespace": "off",
45+
"no-console": "off",
46+
"no-unused-vars": "off",
47+
"prettier/prettier": "error",
48+
"@typescript-eslint/array-type": "error",
49+
"@typescript-eslint/await-thenable": "error",
50+
"@typescript-eslint/ban-ts-comment": "error",
51+
"@typescript-eslint/consistent-type-assertions": "error",
52+
"@typescript-eslint/explicit-member-accessibility":
53+
["error", { "accessibility": "no-public" }],
54+
"@typescript-eslint/func-call-spacing": ["error", "never"],
55+
"@typescript-eslint/no-array-constructor": "error",
56+
"@typescript-eslint/no-empty-interface": "error",
57+
"@typescript-eslint/no-explicit-any": "error",
58+
"@typescript-eslint/no-extraneous-class": "error",
59+
"@typescript-eslint/no-for-in-array": "error",
60+
"@typescript-eslint/no-inferrable-types": "error",
61+
"@typescript-eslint/no-misused-new": "error",
62+
"@typescript-eslint/no-namespace": "error",
63+
"@typescript-eslint/no-non-null-assertion": "warn",
64+
"@typescript-eslint/no-require-imports": "error",
65+
"@typescript-eslint/no-unnecessary-qualifier": "error",
66+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
67+
"@typescript-eslint/no-unused-vars": "error",
68+
"@typescript-eslint/no-useless-constructor": "error",
69+
"@typescript-eslint/no-var-requires": "error",
70+
"@typescript-eslint/prefer-for-of": "warn",
71+
"@typescript-eslint/prefer-function-type": "warn",
72+
"@typescript-eslint/prefer-includes": "error",
73+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
74+
"@typescript-eslint/promise-function-async": "error",
75+
"@typescript-eslint/require-array-sort-compare": "error",
76+
"@typescript-eslint/restrict-plus-operands": "error",
77+
"@typescript-eslint/space-before-function-paren": "off",
78+
"@typescript-eslint/type-annotation-spacing": "error",
79+
"@typescript-eslint/unbound-method": "error"
80+
}

.github/linters/.markdown-lint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Unordered list style
2+
MD004:
3+
style: dash
4+
5+
# Ordered list item prefix
6+
MD029:
7+
style: one
8+
9+
# Spaces after list markers
10+
MD030:
11+
ul_single: 1
12+
ol_single: 1
13+
ul_multi: 1
14+
ol_multi: 1
15+
16+
# Code block style
17+
MD046:
18+
style: fenced

.github/linters/.yaml-lint.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
rules:
2+
document-end: disable
3+
document-start:
4+
level: warning
5+
present: false
6+
line-length:
7+
level: warning
8+
max: 80
9+
allow-non-breakable-words: true
10+
allow-non-breakable-inline-mappings: true

.github/linters/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "../../tsconfig.json",
4+
"compilerOptions": {
5+
"noEmit": true
6+
},
7+
"include": ["../../__tests__/**/*", "../../src/**/*"],
8+
"exclude": ["../../dist", "../../node_modules", "../../coverage", "*.json"]
9+
}

.github/workflows/check-dist.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# In TypeScript actions, `dist/` is a special directory. When you reference
2+
# an action with the `uses:` property, `dist/index.js` is the code that will be
3+
# run. For this project, the `dist/index.js` file is transpiled from other
4+
# source files. This workflow ensures the `dist/` directory contains the
5+
# expected transpiled code.
6+
#
7+
# If this workflow is run from a feature branch, it will act as an additional CI
8+
# check and fail if the checked-in `dist/` directory does not match what is
9+
# expected from the build.
10+
name: Check Transpiled JavaScript
11+
12+
on:
13+
pull_request:
14+
branches:
15+
- main
16+
push:
17+
branches:
18+
- main
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
check-dist:
25+
name: Check dist/
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout
30+
id: checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Node.js
34+
id: setup-node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version-file: .node-version
38+
cache: npm
39+
40+
- name: Install Dependencies
41+
id: install
42+
run: npm ci
43+
44+
- name: Build dist/ Directory
45+
id: build
46+
run: npm run bundle
47+
48+
# This will fail the workflow if the `dist/` directory is different than
49+
# expected.
50+
- name: Compare Directories
51+
id: diff
52+
run: |
53+
if [ ! -d dist/ ]; then
54+
echo "Expected dist/ directory does not exist. See status below:"
55+
ls -la ./
56+
exit 1
57+
fi
58+
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
59+
echo "Detected uncommitted changes after build. See status below:"
60+
git diff --ignore-space-at-eol --text dist/
61+
exit 1
62+
fi
63+
64+
# If `dist/` was different than expected, upload the expected version as a
65+
# workflow artifact.
66+
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
67+
name: Upload Artifact
68+
id: upload
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: dist
72+
path: dist/

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test-typescript:
16+
name: TypeScript Tests
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
id: checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
id: setup-node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version-file: .node-version
29+
cache: npm
30+
31+
- name: Install Dependencies
32+
id: npm-ci
33+
run: npm ci
34+
35+
- name: Check Format
36+
id: npm-format-check
37+
run: npm run format:check
38+
39+
- name: Lint
40+
id: npm-lint
41+
run: npm run lint
42+
43+
- name: Test
44+
id: npm-ci-test
45+
run: npm run ci-test
46+
47+
test-action:
48+
name: GitHub Actions Test
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: Checkout
53+
id: checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Test Local Action
57+
id: test-action
58+
uses: ./
59+
with:
60+
tidal-email: "${{ secrets.TIDAL_EMAIL }}"
61+
tidal-url: "${{ vars.TIDAL_URL }}"
62+
tidal-password: "${{ secrets.TIDAL_PASSWORD }}"
63+
app-id: 2

.github/workflows/linter.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Lint Codebase
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
packages: read
14+
statuses: write
15+
16+
jobs:
17+
lint:
18+
name: Lint Codebase
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
id: checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup Node.js
29+
id: setup-node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version-file: .node-version
33+
cache: npm
34+
35+
- name: Install Dependencies
36+
id: install
37+
run: npm ci
38+
39+
- name: Lint Codebase
40+
id: super-linter
41+
uses: super-linter/super-linter/slim@v6
42+
env:
43+
DEFAULT_BRANCH: main
44+
FILTER_REGEX_EXCLUDE: dist/**/*
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
TYPESCRIPT_DEFAULT_STYLE: prettier
47+
VALIDATE_ALL_CODEBASE: true
48+
VALIDATE_JAVASCRIPT_STANDARD: false
49+
VALIDATE_JSCPD: false

0 commit comments

Comments
 (0)