Upload CI results using GitHub Actions
Add API key as a repository secret
Add the TestLab API key as an encrypted repository secret in your repository settings.
ℹ️
Call the secret
TESTLAB_KEY
and use that secret in the next step.Use the record action in the workflow
Add the action testlabtools/record
to your GitHub workflow that runs tests:
.github/workflows/test.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Important: "fetch-depth: 0" is needed for tag and commit info!
fetch-depth: 0
- name: Run tests
run: <YOUR TEST COMMAND HERE>
- name: Record test results
if: always()
uses: testlabtools/record
env:
TESTLAB_GROUP: e2e # (or "unit", ...)
TESTLAB_KEY: ${{ secrets.TESTLAB_KEY }}
ℹ️
When using
actions/checkout
, set fetch-depth: 0
as shown in the example
above. This allows TestLab to process the necessary tag and commit info.⚠️
Verify that
if: always()
is used for the action testlabtools/record
,
because the action should also run when any of the previously ran tests failed.