sillsdev / fw-nunitreport-action

Use the output of NUnitReporter to report test results

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FieldWorks NUnitReport results publisher action

GitHub Super-Linter Continuous Integration CodeQL Coverage

Initial Setup

After you've cloned the repository to your local machine or codespace, you'll need to perform some initial setup steps before you can develop your action.

Note

You'll need to have a reasonably modern version of Node.js handy (20.x or later should work!). If you are using a version manager like nodenv or nvm, this template has a .node-version file at the root of the repository that will be used to automatically switch to the correct version when you cd into the repository. Additionally, this .node-version file is used by GitHub Actions in any actions/setup-node actions.

  1. 🛠️ Install the dependencies

    npm install
  2. 🏗️ Package the TypeScript for distribution

    npm run bundle
  3. ✅ Run the tests

    npm test

Publishing a new version

  1. Create a new branch

    git checkout -b releases/v1
  2. Make your changes

  3. Add or change tests in __tests__/

  4. Format, test, and build the action

    npm run all

    [!WARNING]

    This step is important! It will run ncc to build the final JavaScript action code with all dependencies included. If you do not run this step, your action will not work correctly when it is used in a workflow. This step also includes the --license option for ncc, which will create a license file for all of the production node modules used in your project.

  5. Commit your changes

  6. Push them to your repository

    git push -u origin releases/v1
  7. Create a pull request and get feedback on your action

  8. Merge the pull request into the main branch

The action is now published! 🚀

Usage

After testing, you can create version tag(s) that developers can use to reference different stable versions of your action. For more information, see Versioning in the GitHub Actions toolkit.

To include the action in a workflow in another repository, you can use the uses syntax with the @ symbol to reference a specific branch, tag, or commit hash.

steps:
  - name: Report Results
    id: test-result-action
    uses: sillsdev/fw-nunitreport-action@v1 # Commit with the `v1` tag
    with:
      log-path: /path/to/nunitreporteroutput
      token: ${{ secrets.GITHUB_TOKEN }}
      encoding: utf-16le # optional tuning to match the output filetype for the runner

Publishing a New Release

This project includes a helper script, script/release designed to streamline the process of tagging and pushing new releases for GitHub Actions.

GitHub Actions allows users to select a specific version of the action to use, based on release tags. This script simplifies this process by performing the following steps:

  1. Retrieving the latest release tag: The script starts by fetching the most recent release tag by looking at the local data available in your repository.
  2. Prompting for a new release tag: The user is then prompted to enter a new release tag. To assist with this, the script displays the latest release tag and provides a regular expression to validate the format of the new tag.
  3. Tagging the new release: Once a valid new tag is entered, the script tags the new release.
  4. Pushing the new tag to the remote: Finally, the script pushes the new tag to the remote repository. From here, you will need to create a new release in GitHub and users can easily reference the new tag in their workflows.

About

Use the output of NUnitReporter to report test results

License:MIT License


Languages

Language:TypeScript 91.5%Language:Shell 8.5%