Skip to content

Commit

Permalink
Removed excess flow
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenJaden committed Nov 23, 2023
1 parent a669aae commit 81bf193
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 141 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/model-merge.yml

This file was deleted.

111 changes: 22 additions & 89 deletions .github/workflows/model.yml
Original file line number Diff line number Diff line change
@@ -1,119 +1,52 @@
name: Model package workflow runner
name: Merge queue workflow runner for model package
on:
push:
merge_group:

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

uses: ./.github/actions/lint
with:
package-name: model

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
uses: ./.github/actions/unit-tests
with:
working-directory: ./packages/model
test-script: yarn test
package-manager: yarn
package-name: model

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
- name: Run mutation tests for changed files
if: ${{ github.event_name == 'push' }}
uses: ./.github/actions/mutation-tests-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
package-name: model
stryker_dashboard_api_key: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

- 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'
- name: Run mutation tests for all files
if: ${{ github.event_name == 'merge_group' }}
uses: ./.github/actions/mutation-tests-all-files
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
#pr_number: ${{ github.event.number }}

- if: steps.changed-files.outputs.src_any_changed == 'true' && steps.run-mutation-tests.outcome == 'failure'
run: exit 1
package-name: model
stryker_dashboard_api_key: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

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
uses: ./.github/actions/build
with:
package-name: model

0 comments on commit 81bf193

Please sign in to comment.