Skip to content

Commit

Permalink
chore: add github workflow (#5)
Browse files Browse the repository at this point in the history
* chore: add github workflow

* Fix tests

* update github actions deps

* only run node 20
  • Loading branch information
remidej authored Nov 2, 2023
1 parent e15f227 commit ad968be
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'Tests'

on:
push:
branches:
- main
pull_request:
paths-ignore:
- '**.md?'

jobs:
lint:
name: 'lint (node: 20)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: 'strapi/blocks-react-renderer'
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 20
- name: 'Install dependencies for linting'
run: yarn install
- name: 'Run lint'
run: yarn lint

unit_tests:
name: 'unit_tests (node: ${{ matrix.node }})'
runs-on: ubuntu-latest
strategy:
matrix:
node: [20]
steps:
- uses: actions/checkout@v4
with:
repository: 'strapi/blocks-react-renderer'
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: 'Run install'
run: yarn install
- name: 'Run tests'
run: yarn test
2 changes: 1 addition & 1 deletion tests/BlocksRenderer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ describe('BlocksRenderer', () => {
createdAt: '2021-01-01',
updatedAt: '2021-01-01',
},
children: [{ type: 'text', text: '' }],
},
]}
/>
Expand Down Expand Up @@ -354,7 +355,6 @@ describe('BlocksRenderer', () => {
{
type: 'text',
text: 'Still my paragraph',
// @ts-expect-error unknown is an invalid modifier
unknown: true,
},
],
Expand Down

0 comments on commit ad968be

Please sign in to comment.