{"id":21273282,"url":"https://github.com/sclorg/testing-farm-as-github-action","last_synced_at":"2025-07-11T06:33:06.667Z","repository":{"id":39635431,"uuid":"446743009","full_name":"sclorg/testing-farm-as-github-action","owner":"sclorg","description":"GitHub Action to execute tests by Testing Farm and update Pull Request status","archived":false,"fork":false,"pushed_at":"2025-07-03T08:18:06.000Z","size":12190,"stargazers_count":14,"open_issues_count":3,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-09T04:04:56.640Z","etag":null,"topics":["github-action","github-actions","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sclorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-11T08:44:10.000Z","updated_at":"2025-07-03T08:18:11.000Z","dependencies_parsed_at":"2024-02-14T13:28:02.968Z","dependency_job_id":"9469d0ee-00a7-43d2-8b09-c40c4631cdf7","html_url":"https://github.com/sclorg/testing-farm-as-github-action","commit_stats":{"total_commits":210,"total_committers":10,"mean_commits":21.0,"dds":0.680952380952381,"last_synced_commit":"c41d749c3d6edde07ac7a782dc34ce89f14607e8"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/sclorg/testing-farm-as-github-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Ftesting-farm-as-github-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Ftesting-farm-as-github-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Ftesting-farm-as-github-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Ftesting-farm-as-github-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sclorg","download_url":"https://codeload.github.com/sclorg/testing-farm-as-github-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Ftesting-farm-as-github-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264748065,"owners_count":23657958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-action","github-actions","testing"],"created_at":"2024-11-21T09:13:17.981Z","updated_at":"2025-07-11T06:33:06.662Z","avatar_url":"https://github.com/sclorg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# testing-farm-as-github-action\n\n[![codecov][codecov-status]][codecov]\n\n[codecov]: https://codecov.io/github/sclorg/testing-farm-as-github-action\n[codecov-status]: https://codecov.io/github/sclorg/testing-farm-as-github-action/graph/badge.svg\n\nTesting Farm as GitHub Action is a GitHub Action for executing tests on the [Testing Farm Service](https://docs.testing-farm.io). Action using Node.js Library [testing-farm](https://www.npmjs.com/package/testing-farm) for communication with Testing Farm API.\n\nThe tests to run are to be described with a [`tmt` plan](https://tmt.readthedocs.io/en/stable/guide.html#plans) by the user of this GitHub Action.\nPull Request status is automatically updated after the tests are executed,\nif this option is enabled with the `update_pull_request_status` user-defined input variable.\n\nAPI key to the Testing Farm MUST be stored in your organization's secrets to successfully access its infrastructure.\nSee [Testing Farm onboarding guide](https://docs.testing-farm.io/Testing%20Farm/0.1/onboarding.html) for information how to onboard to Testing Farm.\n\n## Compatibility Notes\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e Currently only testing of copr builds is supported by the action.\n\u003e See [Testing Farm docs](https://docs.testing-farm.io) for more information on supported test artifacts which Testing \u003e \u003e Farm can install into the environment.\n\n## Action Inputs\n\n### Testing Farm\n\n| Input Name | Description | Default value |\n|------------|-------------|---------------|\n| `api_key`  | Testing farm API key | empty, **required from user** |\n| `api_url`  | Testing farm API server url | https://api.dev.testing-farm.io/v0.1 |\n| `tf_scope` | Define the scope of Testing Farm. Possible options are 'public' or 'private' | public |\n\n### Tmt Metadata\n\n| Input Name | Description | Default value |\n|------------|-------------|---------------|\n| `git_url` | An url to the repository with tmt metadata | url of repo that runs GHA |\n| `git_ref` | A tmt tests branch, tag or commit specifying the desired git revision which will be used for tests | `github.ref` when available, otherwise `master` |\n| `tmt_plan_regex` | A regular expression used to select tmt plans | all |\n| `tmt_plan_filter` | A filter used to select tmt plans [plan_filter](https://docs.testing-farm.io/Testing%20Farm/0.1/test-request.html#plan-filter) | \"\" |\n| `tmt_context` | A mapping of tmt context variable [tmt-context](https://tmt.readthedocs.io/en/latest/spec/context.html), variables separated by ; | empty |\n| `tmt_path` |  A path in the repository with tmt metadata | \".\" |\n\n### Test Environment\n\n| Input Name | Description | Default value |\n|------------|-------------|---------------|\n| `compose` | Compose to run tests on. [Available composes.](https://api.dev.testing-farm.io/v0.1/composes) Use `null` to skip compose specification - needed for container provisioner with image specified in plan. | Fedora-latest |\n| `arch` | Define an architecture for testing environment | x86_64 |\n| `variables` | Environment variables for test env, separated by ; | empty |\n| `secrets` | Environment secrets for test env, separated by ; | empty |\n| `tmt_hardware` | Hardware definition for test env | empty |\n\n### Test Artifacts\n\n| Input Name | Description | Default value |\n|------------|-------------|---------------|\n| `copr` | Copr name to use for the artifacts | epel-7-x86_64 |\n| `copr_artifacts` | `fedora-copr-build` artifacts for testing environment, separated by ; | empty |\n\n### Miscellaneous\n\n| Input Name | Description | Default value |\n|------------|-------------|---------------|\n| `github_token` | GitHub token passed from secrets | `${{ github.token }}` |\n| `create_issue_comment` | If GitHub action will create a github issue comment | false |\n| `pull_request_status_name` | GitHub pull request status name is also used as the name of the test in the Job Summary and in comments. | Fedora |\n| `update_pull_request_status` | Action will update pull request status. | false |\n| `environment_settings` | Pass custom settings to the test environment. | empty |\n| `pipeline_settings` | Pass specific settings for the testing farm pipeline. For example, `'{ \"type\": \"tmt-multihost\" }'`. For details, see `settings.pipeline` field in [Request new test](https://api.testing-farm.io/redoc#operation/request_a_new_test_v0_1_requests_post). | empty |\n| `create_github_summary` | Create GitHub Job Summary accessible from Workflow run Summary. Possible options: \"true\" or \"false\" | true |\n| `timeout` | Timeout for the Testing Farm job in minutes. | 480 |\n| `repo_owner` | Owner of the repository | `${{ github.repository_owner }}` |\n| `repo_name` | Name of the repository | undefined |\n| `pr_number` | Pull request number for showing the results | undefined |\n| `commit_sha` | Sha of the commit triggering the action | undefined |\n\n## Action Outputs\n\n| Output Name | Description |\n|-------------|-------------|\n| `request_id` | An ID of a scheduled testing farm request. |\n| `request_url` | An URL of a scheduled testing farm request. |\n| `test_log_url` | An URL of a scheduled test logs. |\n\n\u003e [!TIP]\n\u003e\n\u003e Testing Farm as GitHub Action requires a GitHub token with the following permissions:\n\u003e\n\u003e ```yaml\n\u003e permissions:\n\u003e   contents: read\n\u003e   # This is required for the ability to create Issue comment\n\u003e   pull-requests: write\n\u003e   # This is required for the ability to create/update the Pull request status\n\u003e   statuses: write\n\u003e ```\n\n## Examples\n\n### Pull request example\n\nThe example below shows how the `sclorg/testing-farm-as-github-action` action can be used to schedule tests on Testing Farm.\n\n```yaml\nname: Schedule test on Testing Farm\non:\n  issue_comment:\n    types:\n      - created\n\n# The concurrency key is used to prevent multiple workflows from running at the same time\nconcurrency:\n  group: my-concurrency-group\n  cancel-in-progress: true\n\njobs:\n  tests:\n    runs-on: ubuntu-latest\n    # Let's schedule tests only on user request. NOT automatically.\n    # Only repository owner or member can schedule tests\n    if: |\n      github.event.issue.pull_request\n      \u0026\u0026 contains(github.event.comment.body, '[test]')\n      \u0026\u0026 contains(fromJson('[\"OWNER\", \"MEMBER\"]'), github.event.comment.author_association)\n    steps:\n      - name: Schedule test on Testing Farm\n        uses: sclorg/testing-farm-as-github-action@v4\n        with:\n          api_key: ${{ secrets.TF_API_KEY }}\n          tmt_plan_regex: \"smoke\"\n          pull_request_status_name: \"Smoke test\"\n```\n\nand as soon as the job is finished you will see the test results in the pull request status:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/statuses.png\" width=\"600\" alt=\"Statuses example\" /\u003e\n\u003c/p\u003e\n\n### Run workflow at push to the main branch\n\nThe example below shows how the `sclorg/testing-farm-as-github-action` action can be used when pushing commits to `main` branch.\n\n```yaml\nname: Testing repository by Testing Farm when push to main branch\non:\n  push:\n    branches:\n      - main\n\n# The concurrency key is used to prevent multiple workflows from running at the same time\nconcurrency:\n  group: ${{ github.head_ref }}\n  cancel-in-progress: true\n\njobs:\n  tests:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Schedule test on Testing Farm\n        uses: sclorg/testing-farm-as-github-action@v4\n        with:\n          api_key: ${{ secrets.TF_API_KEY }}\n```\n\n### Using compose: null\n\nWhen you want to run tests without specifying a specific compose, you can use `compose: null`. This will skip the `os` field in the API request entirely. This is needed if you want to run testing against the container provisioner with the image specified in the plan. Specifying the container image via the API is not supported.\n\n```yaml\nname: Test with container provisioner\non:\n  push:\n    branches:\n      - main\n\njobs:\n  tests:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Schedule test on Testing Farm\n        uses: sclorg/testing-farm-as-github-action@v4\n        with:\n          api_key: ${{ secrets.TF_API_KEY }}\n          compose: null\n```\n\n### How to setup Pull Request summary comments\n\nSet the following inputs:\n\n- `create_issue_comment: 'true'`\n- `pull_request_status_name: 'Test name'`\n\nAction uses the `pull_request_status_name` as the name of the test. Also it is used to distinguish between different tests when running multiple tests in parallel.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/summary-comment.png\" width=\"600\" alt=\"Summary comment example\" /\u003e\n\u003c/p\u003e\n\n\u003e [!WARNING]\n\u003e\n\u003e When running multiple tests in parallel, you can encounter race conditions when updating the summary comment. We have implemented a locking mechanism to prevent this issue, but currently there is no proper way how to synchronize independent workflow jobs. Statuses are updated independently so they don't have this issue and are always up to date.\n\n---\n\nUseful documents: _[USAGE](USAGE.md)_ | _[DEVELOPMENT](DEVELOPMENT.md)_ | _[LICENSE](LICENSE)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsclorg%2Ftesting-farm-as-github-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsclorg%2Ftesting-farm-as-github-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsclorg%2Ftesting-farm-as-github-action/lists"}