From 6a7ac6b8ba5636dc6d401002ede8028df58dee51 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 17:49:39 +0100 Subject: [PATCH] infra: unit test via github action --- .circleci/config.yml | 12 ------------ .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 594792ec..ff02152f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,18 +62,6 @@ jobs: paths: - ./node_modules - <<: *save - lint: - docker: - - <<: *node-image - steps: - - <<: *restore - - run: npm run lint - test: - docker: - - <<: *node-image - steps: - - <<: *restore - - run: npm test test-pg-9: docker: - <<: *node-image diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 304636bb..541b31b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,41 @@ permissions: contents: read # to fetch code (actions/checkout) jobs: + unit-test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node_version: [18, 20] + fail-fast: false + timeout-minutes: 10 + + name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Test + run: pnpm run test + lint: runs-on: ubuntu-latest timeout-minutes: 10