tim-balloon / TIMflight

Flight MCP repo
0 stars 0 forks source link

Add unit tests to GitHub Actions #17

Closed evanmayer closed 2 years ago

evanmayer commented 2 years ago

Task

Pull Request #14 added some new functions, and they came with unit tests. Make a GitHub Action we can customize to run unit tests.

Acceptance

Nick's new unit tests are executed and output is checked using GitHub actions upon AT LEAST pull request and push to the main dev branch.

Details

https://docs.github.com/en/actions

This should be a new "Workflow" in GitHub Actions, separate from the Build-ground-software workflow. Thus, it will need a new .yml to be created in the .github/workflows/ folder.

You may cast about for a template to modify, plenty of options/a search box here.

Testing new GitHub actions without doing it in the main branch can be a bit tricky. Here's how Evan did it (IIRC):

  1. Check out your feature branch
  2. Create the new .yml file for the Action
  3. Add the name of your feature branch to this section at the top of the .yml:
on:
  push:
    branches:
    - feature-branch-name
  1. Commit and push the .yml
  2. Verify that when you push a change from your local machine to the GitHub remote, the GitHub Action for that .yml kicks off.
evanmayer commented 2 years ago

It is not yet possible to run these unit tests in GH Actions with the build system in its current state. The CMake is written to build and run tests with -DENABLE_TESTING=ON, when building mcp. However, mcp cannot yet be built in a non-flight computer or non-Vagrant environment, so these tests are only useful there for now.

Revisit when we move to build mcp in a newer env., wontfix for now.