Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github actions support for library CI testing #2577

Merged
merged 4 commits into from
Oct 31, 2022

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Oct 29, 2022

This PR adds a re-usable library workflow for Github actions so that Sming libraries can be independently tested.
It also tidies up the main ci.yml file and fixes a couple of minor related issues.

The library.yml re-useable workflow is provided, which takes care of these tasks:

  • Checking in the library to test
  • Checking in the Sming framework
  • Installing build tools
  • Builds all applications within the library's samples directory, for all supported architectures
  • If a test application is provided then that should be located in a test directory.
    This is built for all architectures, and also executed for Host.

Builds are handled using :source:Tools/ci/library/Makefile.

See also https://docs.github.com/en/actions/using-workflows/reusing-workflows.

To use this in a project, add a suitable workflow to the .github/workflows directory. Templates are provided in the .github/workflows/library directory.

Here is the basic push scenario:

name: CI Push
on: [push]
jobs:
  build:
  uses: SmingHub/Sming/.github/workflows/library.yml@develop
  # Inputs are all optional, defaults are shown
  with:
    # Repository to fetch Sming from
    sming_repo: 'https://github.com/SmingHub/Sming'
    # Sming branch to run against
    sming_branch: 'develop'
    # Library alias
    alias: ''

The sming_repo and sming_branch inputs are provided if your library requires modifications to Sming which are not (yet) in the main repository.

The alias input is required where the library repository name does not correspond with the working title. For example, the jerryscript library is in a repository called Sming-jerryscript, so must be checked out using a different name. If Sming contains a library (or Component) with the same name then it will be overridden,
with a warning Multiple matches found for Component 'jerryscript' in the build log.

The ci-dispatch.yml example demonstrates manual triggering, which allows these inputs to be easily changed. See https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow.

Note that the workflow must be available in the library's default branch, or it will not appear in the github web page.

@mikee47
Copy link
Contributor Author

mikee47 commented Oct 29, 2022

NB. This won't work of course until added to Sming repo. See https://github.com/mikee47/Sming-jerryscript/actions/runs/3350862770 for test run.

@slaff slaff added this to the 4.7.0 milestone Oct 31, 2022
@slaff slaff merged commit ebd8feb into SmingHub:develop Oct 31, 2022
@mikee47 mikee47 deleted the feature/library-ci branch October 31, 2022 12:23
@slaff slaff mentioned this pull request Nov 8, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants