diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml new file mode 100644 index 0000000..22ca549 --- /dev/null +++ b/.github/workflows/unit_test.yml @@ -0,0 +1,33 @@ +name: tests + +on: + pull_request: + - main + + +jobs: + test: + name: unit tests + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + + - name: Cache dependencies + id: yarn-cache + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Install dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install --frozen-lockfile + + - name: run tests + run: yarn test