feat(adapters): caret adapter basic implementation #57
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Model package workflow runner | |
on: | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
- uses: ./.github/actions/setup | |
- name: Run ESLint check | |
run: yarn workspace @editorjs/model lint:ci | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
- uses: ./.github/actions/setup | |
- name: Run unit tests | |
uses: ArtiomTr/jest-coverage-report-action@v2 | |
with: | |
working-directory: ./packages/model | |
test-script: yarn test | |
package-manager: yarn | |
mutation-tests: | |
runs-on: ubuntu-latest | |
env: | |
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
- name: Setup environment | |
uses: ./.github/actions/setup | |
- name: Get changed files | |
uses: tj-actions/[email protected] | |
id: changed-files | |
with: | |
files_yaml: | | |
src: | |
- 'src/**/*.ts' | |
- '!src/**/*.spec.ts' | |
- '!src/**/__mocks__/**' | |
separator: "','" | |
path: packages/model | |
- name: Run mutation tests | |
if: steps.changed-files.outputs.src_any_changed == 'true' | |
id: run-mutation-tests | |
run: yarn workspace @editorjs/model test:mutations --mutate ${{format('''{0}''', steps.changed-files.outputs.src_all_changed_files)}} | |
continue-on-error: true | |
- name: Comment on successful mutation testing | |
uses: thollander/actions-comment-pull-request@v2 | |
if: steps.changed-files.outputs.src_any_changed == 'true' && steps.run-mutation-tests.outcome == 'success' | |
with: | |
message: | | |
## ✅ Mutation testing passed | |
Report: https://dashboard.stryker-mutator.io/reports/github.com/editor-js/document-model/PR-${{ github.event.number }} | |
<details> | |
<summary>Mutated files</summary> | |
<pre> | |
${{ join(fromJson(format('[{0}]', format('''{0}''', steps.changed-files.outputs.src_all_changed_files))), '<br />') }} | |
</pre> | |
</details> | |
comment_tag: mutation-tests | |
- name: Comment on failed mutation testing | |
uses: thollander/actions-comment-pull-request@v2 | |
if: steps.changed-files.outputs.src_any_changed == 'true' && steps.run-mutation-tests.outcome == 'failure' | |
with: | |
message: | | |
## ❌ Mutation testing hasn't passed score threshold | |
Report: https://dashboard.stryker-mutator.io/reports/github.com/editor-js/document-model/PR-${{ github.event.number }} | |
<details> | |
<summary>Mutated files</summary> | |
<pre> | |
${{ join(fromJson(format('[{0}]', format('''{0}''', steps.changed-files.outputs.src_all_changed_files))), '<br />') }} | |
</pre> | |
</details> | |
comment_tag: mutation-tests | |
- name: Comment on empty changes | |
uses: thollander/actions-comment-pull-request@v2 | |
if: steps.changed-files.outputs.src_any_changed == 'false' | |
with: | |
message: | | |
## ⏭️ No files to mutate | |
comment_tag: mutation-tests | |
- if: steps.changed-files.outputs.src_any_changed == 'true' && steps.run-mutation-tests.outcome == 'failure' | |
run: exit 1 | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
- uses: ./.github/actions/setup | |
- name: Build the package | |
run: yarn workspace @editorjs/model build |