Skip to content

Commit

Permalink
feat: v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Dec 15, 2023
1 parent 8eea525 commit 1295fe0
Show file tree
Hide file tree
Showing 24 changed files with 86,347 additions and 10,484 deletions.
9 changes: 2 additions & 7 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
env:
node: true
es6: true
jest: true

globals:
Atomics: readonly
Expand All @@ -10,8 +9,8 @@ globals:
ignorePatterns:
- '!.*'
- '**/node_modules/.*'
- '**/dist/.*'
- '**/coverage/.*'
- '*.js'
- 'ghjk.ts'
- '*.json'

parser: '@typescript-eslint/parser'
Expand All @@ -24,15 +23,13 @@ parserOptions:
- './tsconfig.json'

plugins:
- jest
- '@typescript-eslint'

extends:
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:github/recommended
- plugin:jest/recommended

rules:
{
Expand All @@ -51,8 +48,6 @@ rules:
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-member-accessibility':
['error', { 'accessibility': 'no-public' }],
'@typescript-eslint/explicit-function-return-type':
['error', { 'allowExpressions': true }],
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
Expand Down
9 changes: 7 additions & 2 deletions .github/linters/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"compilerOptions": {
"noEmit": true
},
"include": ["../../__tests__/**/*", "../../src/**/*"],
"exclude": ["../../dist", "../../node_modules", "../../coverage", "*.json"]
"include": ["../../src/*.ts"],
"exclude": [
"../../src/*.js",
"../../src/ghjk.ts",
"../../node_modules",
"*.json"
]
}
18 changes: 9 additions & 9 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# In TypeScript actions, `dist/` is a special directory. When you reference
# In TypeScript actions, `dist/`(index.js) is a special directory. When you reference
# an action with the `uses:` property, `dist/index.js` is the code that will be
# run. For this project, the `dist/index.js` file is transpiled from other
# source files. This workflow ensures the `dist/` directory contains the
Expand All @@ -20,7 +20,7 @@ permissions:

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

steps:
Expand All @@ -39,26 +39,26 @@ jobs:
id: install
run: npm ci

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

# This will fail the workflow if the PR wasn't created by Dependabot.
- name: Compare Directories
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
if [ "$(git diff --ignore-space-at-eol --text index.js | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text dist/
git diff --ignore-space-at-eol --text index.js
exit 1
fi
# If `dist/` was different than expected, and this was not a Dependabot
# If `index.js` was different than expected, and this was not a Dependabot
# PR, upload the expected version as a workflow artifact.
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
name: Upload Artifact
id: upload
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
name: index.js
path: index.js
36 changes: 2 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,6 @@ 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

test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest
Expand All @@ -54,8 +22,8 @@ jobs:
- name: Test Local Action
id: test-action
uses: ./
with:
milliseconds: 2000
env:
GHJK_VERSION: 6040bb3

- name: Print Output
id: output
Expand Down
17 changes: 0 additions & 17 deletions __tests__/index.test.ts

This file was deleted.

89 changes: 0 additions & 89 deletions __tests__/main.test.ts

This file was deleted.

25 changes: 0 additions & 25 deletions __tests__/wait.test.ts

This file was deleted.

51 changes: 32 additions & 19 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
name: 'The name of your action here'
description: 'Provide a description here'
author: 'Your name or organization here'

# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: 'heart'
color: 'red'

# Define your inputs here.
name: 'Setup Ghjk'
description: 'Installs ghjk and syncs ports'
inputs:
milliseconds:
description: 'Your input description here'
version:
description: 'Github version/branch to install from'
required: false
skip-deno-install:
description: 'Use to avoid share another deno exec already installed in workflow'
required: false
default: false
installer-url:
description: 'Alternative installer script to use'
required: false
sync:
description: 'Disable to skip syncing ports'
required: true
default: '1000'

# Define your outputs here.
outputs:
time:
description: 'Your output description here'
default: true
cache-disable:
description: 'Enable to skip caching the GHJK dir'
required: true
default: false
cache-save-if:
description: "Toggle cache saving. To disable cache restore as well, use cache-disable"
required: true
default: true
cache-key-prefix:
description: 'Prefix to use for the cache key. v0-ghjk by default'
required: false
cache-key-env-vars:
description: "Additional environment variables to include in the cache key, separated by comma."
required: false

runs:
using: node20
main: dist/index.js
main: ./main.cjs
post: ./post.cjs
post-if: "success() || env.CACHE_ON_FAILURE == 'true'"
1 change: 0 additions & 1 deletion badges/coverage.svg

This file was deleted.

Loading

0 comments on commit 1295fe0

Please sign in to comment.