-
Notifications
You must be signed in to change notification settings - Fork 0
First implementation #1
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: GitHub action publish new version | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
versionType: | ||
type: choice | ||
description: Version Type | ||
required: true | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
permissions: | ||
contents: write | ||
jobs: | ||
publish: | ||
name: Publish github action version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Install npm deps | ||
run: npm ci | ||
|
||
- name: Configure git | ||
run: git config --global user.email "[email protected]" && git config --global user.name "y-infra" | ||
|
||
- name: Bump version | ||
run: npm version ${{ github.event.inputs.versionType }} | ||
|
||
- name: Build github action | ||
run: npm run ci:build | ||
|
||
- name: Commit version | ||
run: git add dist -f && git commit --amend --no-edit dist && git push --follow-tags |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Testplane CI | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Тестовый флоу.
|
||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Cache npm dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: Install npm deps | ||
run: npm ci | ||
|
||
- name: Run unit tests | ||
run: npm run unit | ||
|
||
- name: Run lint | ||
run: npm run lint | ||
|
||
- name: Build GitHub action | ||
run: npm run ci:build | ||
|
||
- name: Run Testplane action | ||
id: testplane | ||
uses: ./ | ||
with: | ||
cwd: testplane-project-example | ||
|
||
- name: Deploy report | ||
if: always() && steps.testplane.outputs.html-report-path | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ${{ steps.testplane.outputs.html-report-path }} | ||
destination_dir: ${{ steps.testplane.outputs.html-report-path }} | ||
keep_files: true | ||
|
||
- name: Comment PR with link to Testplane HTML report | ||
if: always() && steps.testplane.outputs.html-report-path | ||
uses: thollander/actions-comment-pull-request@v3 | ||
with: | ||
message: | | ||
### Testplane run finisned | ||
|
||
Testplane HTML-report is available at https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.testplane.outputs.html-report-path }} | ||
comment-tag: testplane_html_report_link |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
dist/dev.js | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Собирается с There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А почему в игноре не весь dist? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.18.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Максимальная версия, поддерживаемая github actions |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: 'Testplane action' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Конфиг github action |
||
description: 'GitHub action for Testplane' | ||
runs: | ||
using: 'node20' | ||
main: 'dist/index.js' | ||
inputs: | ||
cwd: | ||
description: 'Relative directory to run Testplane in' | ||
required: false | ||
default: '.' | ||
package-manager: | ||
description: 'Package manager, used in the project (one of "npm", "pnpm", "yarn")' | ||
required: false | ||
default: 'npm' | ||
html-report-prefix: | ||
description: 'Html-reporter report path prefix' | ||
required: false | ||
default: 'testplane-reports' | ||
config-path: | ||
description: 'Testplane custom config path' | ||
required: false | ||
default: '' | ||
storybook: | ||
description: 'If enabled, uses @testplane/storybook plugin tests' | ||
required: false | ||
default: '' | ||
set: | ||
description: 'Comma separated list of sets to test' | ||
required: false | ||
default: '' | ||
browser: | ||
description: 'Comma separated list of browsers to test' | ||
required: false | ||
default: '' | ||
grep: | ||
description: 'Grep expression to specify tests to launch' | ||
required: false | ||
default: '' | ||
outputs: | ||
html-report-path: | ||
description: 'Path to html report, generated by html-reporter' | ||
exit-code: | ||
description: 'Testplane run exit code' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pluginJs from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
import eslintConfigPrettier from "eslint-config-prettier"; | ||
import eslintPluginPrettier from "eslint-plugin-prettier/recommended"; | ||
|
||
export default [ | ||
{ files: ["**/*.{js,mjs,cjs,ts}"] }, | ||
{ files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } }, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
eslintConfigPrettier, | ||
eslintPluginPrettier, | ||
]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Взял вот отсюда: https://nda.ya.ru/t/OvHYlqSL7BLF9p |
||
"extensionsToTreatAsEsm": [ | ||
".ts" | ||
], | ||
"moduleNameMapper": { | ||
"^(\\.{1,2}/.*)\\.js$": "$1" | ||
}, | ||
"preset": "ts-jest/presets/default-esm", | ||
"testEnvironment": "node", | ||
"testMatch": [ | ||
"**/*.test.ts" | ||
], | ||
"transform": { | ||
"^.+\\.ts$": [ | ||
"ts-jest", | ||
{ | ||
"isolatedModules": true, | ||
"useESM": true | ||
} | ||
] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Флоу для релиза новой версии github action
Собирает новую версию action и коммитит ее в мастер