> For the complete documentation index, see [llms.txt](https://docs.currents.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.currents.dev/getting-started/other-frameworks/others/ci-setup/node-github-actions.md).

# Node.js - GitHub Actions

Running Node.js Tests on GitHub Actions

{% hint style="info" %}
TL;DR Check out the example repository:

[https://github.com/currents-dev/currents-examples](https://github.com/currents-dev/currents-examples/tree/main/generic-reporter/junit/nodejs-github-actions)
{% endhint %}

Here's an example workflow configuration file:

{% code title=".github/workflows /node.yml" overflow="wrap" %}

```yaml
name: Run Node.JS

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        shard: [1, 2]

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "24.x"

      - name: Install dependencies
        run: npm install

      - name: install currents
        run: npm install @currents/node-test-reporter @currents/cmd

      - name: Run tests in shard ${{ matrix.shard }}
        run: node --test --test-shard=${{ matrix.shard }}/2 --test-reporter @currents/node-test-reporter --test-reporter-destination=./report.xml tests/**.test.mjs || true && echo '✅ Script executed successfully'

      - name: Convert and upload test results to Currents.dev
        # CURRENTS_RECORD_KEY is a secret stored in the repository settings
        env:
          CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
        run: |
          npx currents run upload --project-id JOw2i3 --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }} --input-format=junit --input-file=./report.xml --framework=node

```

{% endcode %}

* Get your [Record Key](/guides/record-key.md) and set [GH secret](https://docs.github.com/en/actions/reference/encrypted-secrets) variable`CURRENTS_RECORD_KEY`.
* Set the Project ID
  * Option 1: Update the `--project-id` argument of `npx currents run upload` to [your project's id](/dashboard/projects/project-settings.md).
  * Option 2: Set it up in the [reporter config](https://docs.currents.dev/resources/reporters/currents-jest#configuration) instead.

### Explore

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>@currents/node-test-reporter</td><td></td><td></td><td><a href="/resources/reporters/currents-jest.md">@currents/jest</a></td></tr><tr><td>CI Build ID</td><td></td><td></td><td><a href="/guides/parallelization-guide/ci-build-id.md">CI Build ID</a></td></tr><tr><td>@currents/cmd</td><td></td><td></td><td></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.currents.dev/getting-started/other-frameworks/others/ci-setup/node-github-actions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
