diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7ed586b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: "test" + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + # Make sure the actual branch is checked out when running on pull requests + ref: ${{ github.head_ref }} + repository: ${{github.event.pull_request.head.repo.full_name || github.repository }} + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: yarn install --immutable + + - name: Test + run: yarn run test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + directory: ./coverage/ + fail_ci_if_error: true + verbose: true