From ad968be14167692aeb3f79e354f88dc9e5176f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20de=20Juvigny?= <8087692+remidej@users.noreply.github.com> Date: Thu, 2 Nov 2023 10:54:37 +0100 Subject: [PATCH] chore: add github workflow (#5) * chore: add github workflow * Fix tests * update github actions deps * only run node 20 --- .github/workflows/tests.yml | 45 +++++++++++++++++++++++++++++++++++ tests/BlocksRenderer.test.tsx | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..2bf975d --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 diff --git a/tests/BlocksRenderer.test.tsx b/tests/BlocksRenderer.test.tsx index 04ec66e..1000fc3 100644 --- a/tests/BlocksRenderer.test.tsx +++ b/tests/BlocksRenderer.test.tsx @@ -218,6 +218,7 @@ describe('BlocksRenderer', () => { createdAt: '2021-01-01', updatedAt: '2021-01-01', }, + children: [{ type: 'text', text: '' }], }, ]} /> @@ -354,7 +355,6 @@ describe('BlocksRenderer', () => { { type: 'text', text: 'Still my paragraph', - // @ts-expect-error unknown is an invalid modifier unknown: true, }, ],