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

feat: add v1 version of action #2

Merged
merged 33 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
feb8d49
feat: add v1 version of action
lesyk-lesyk Apr 29, 2024
a5302f5
chore: update code owners
lesyk-lesyk Apr 29, 2024
bec6b35
chore: update code owners
lesyk-lesyk Apr 29, 2024
2b03b35
chore: remove CodeQL workflow
lesyk-lesyk May 9, 2024
614ea48
chore: update action manifest
lesyk-lesyk May 10, 2024
55adee7
chore: update ci workflow
lesyk-lesyk May 10, 2024
8eeeeaa
chore: add contributing docs
lesyk-lesyk May 13, 2024
d95c474
chore: update descriptions
lesyk-lesyk May 13, 2024
0a1dbd8
chore: run prettier
lesyk-lesyk May 13, 2024
944f3da
chore: add PR template
lesyk-lesyk May 13, 2024
1ac79a3
chore: run prettier
lesyk-lesyk May 13, 2024
1fe01da
Apply suggestions from code review
lesyk-lesyk May 13, 2024
085e11a
Update script/release
lesyk-lesyk May 13, 2024
38823cf
Update src/main.ts
lesyk-lesyk May 13, 2024
05284ae
chore: add code owners
lesyk-lesyk May 13, 2024
247b3db
chore: remove unused badge
lesyk-lesyk May 13, 2024
c203ed6
feat: add if statement for author name and email
lesyk-lesyk May 13, 2024
0837bf2
chore: enable semicolons
lesyk-lesyk May 14, 2024
9cffe12
test: remove skipped test
lesyk-lesyk May 14, 2024
5fb5396
chore: build dist
lesyk-lesyk May 14, 2024
b3fcb50
test: add happy path unit tests
lesyk-lesyk May 14, 2024
131f9d4
test: mock process env
lesyk-lesyk May 14, 2024
0d2b1d6
chore: add trailing comma
lesyk-lesyk May 14, 2024
01b2aa0
chore: fix issue with TS in tests
lesyk-lesyk May 14, 2024
297c083
chore: update coverage threshold
lesyk-lesyk May 14, 2024
8871ef2
chore: add silent option to jest tests
lesyk-lesyk May 14, 2024
8da9d72
Update README.md
lesyk-lesyk May 15, 2024
bc7c73f
chore: run prettier for readme
lesyk-lesyk May 15, 2024
5dc4aa5
chore: update npm scripts
lesyk-lesyk May 15, 2024
6f3def5
feat: add default values to action.yaml
lesyk-lesyk May 15, 2024
393c7f4
chore: build action
lesyk-lesyk May 15, 2024
37749c4
feat: remove redoclyConfigPath input param
lesyk-lesyk May 17, 2024
390d02d
feat: add "required" option to action inputs
lesyk-lesyk May 17, 2024
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Repository CODEOWNERS

@Redocly/plug-and-play
5 changes: 3 additions & 2 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ignorePatterns:
- '**/dist/.*'
- '**/coverage/.*'
- '*.json'
- 'fake-api-server/**/*'

parser: '@typescript-eslint/parser'

Expand Down Expand Up @@ -76,8 +77,8 @@ rules:
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/semi': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unbound-method': 'error'
'@typescript-eslint/unbound-method': 'error',
}
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## What/Why/How?

<!-- Summarize your changes briefly.
Avoid long-winded descriptions. Be precise and concise. -->

## Reference

<!-- Add references if applicable -->

## Testing

<!-- Describe how these changes have been tested or list testing steps. -->

## Screenshots / Video (optional)

<!-- If useful, provide screenshots or videos of your changes. -->

## Additional context

<!-- If useful, provide additional context. -->
67 changes: 0 additions & 67 deletions .github/workflows/check-dist.yml

This file was deleted.

114 changes: 102 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous Integration
name: CI

on:
pull_request:
Expand All @@ -10,10 +10,13 @@ on:

permissions:
contents: read
statuses: write

# TODO: add caching for node_modules between jobs

jobs:
test-typescript:
name: TypeScript Tests
code-quality:
name: Code Quality
runs-on: ubuntu-latest

steps:
Expand All @@ -33,32 +36,119 @@ jobs:
run: npm ci

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

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

- name: Test
test-unit:
name: Unit 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: Unit tests
id: npm-ci-test
run: npm run ci-test
run: npm run test:ci

# In TypeScript actions, `dist/` 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
# expected transpiled code.
#
# If this workflow is run from a feature branch, it will act as an additional CI
# check and fail if the checked-in `dist/` directory does not match what is
# expected from the build.
check-dist:
name: Check "dist" folder
runs-on: ubuntu-latest

test-action:
name: GitHub Actions Test
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

# 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
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text dist/
exit 1
fi

# If `dist/` 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@v4
with:
name: dist
path: dist/

test-smoke:
name: Action smoke test
runs-on: ubuntu-latest

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

- name: Test Local Action
- name: Install modules
id: install-modules
run: npm install

- name: Start fake server
id: fake-server-start
run: npm run fake-server:start

- name: Run Local Action
id: test-action
uses: ./
with:
milliseconds: 2000
organization: 'ci-test-org'
project: 'ci-test-project'
domain: 'http://localhost:3000'
files: 'tests/test-folder-1 tests/test-root-file.yaml'
mountPath: 'test-folder'
env:
REDOCLY_AUTHORIZATION: ${{ secrets.REDOCLY_AUTHORIZATION }}

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
run: echo "${{ steps.test-action.outputs.pushId }}"
48 changes: 0 additions & 48 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/linter.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ __tests__/runner/*
.idea
.vscode
*.code-workspace

# Custom
fake-api-server/.dist
results.json
4 changes: 2 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "none",
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": true,
"arrowParens": "avoid",
Expand Down
3 changes: 0 additions & 3 deletions CODEOWNERS

This file was deleted.

Loading