Electron
Integrate TestDriver with Electron applications
To integrate TestDriver with a workflow that uses the runner artifact URL and GitHub token for downloading artifacts, you can modify the workflow to include these steps. Below is an example of how to adapt the workflow to ensure TestDriver can access the artifacts.
Updated workflow with TestDriver integration
This workflow builds the application, uploads the build as an artifact, and then uses TestDriver to download the artifact via the runner artifact URL and run tests.
Workflow file: .github/workflows/testdriver-integration.yaml
Key changes and explanation
1. Artifact URL Retrieval
The Get Artifact URL
step constructs the artifact URL dynamically using the GitHub repository and server URL. This ensures the TestDriver runner can download the artifact.
2. Downloading the artifact
The prerun
script in the TestDriver action uses curl
to download the artifact from the runner URL. The GITHUB_TOKEN
is passed as a header for authentication.
3. TestDriver integration
The TestDriver action is configured to:
- Download the artifact.
- Extract the artifact.
- Run the application.
- Execute the specified test steps.
Secrets configuration
Add the following secrets to your GitHub repository:
TD_API_KEY
: Your TestDriver API key.GITHUB_TOKEN
: Automatically provided by GitHub Actions for authentication.
Benefits of this workflow
- Dynamic Artifact Access: Ensures TestDriver can download artifacts directly from the runner.
- Automated Testing: Integrates TestDriver to validate the application after the build.
- Secure Authentication: Uses the GitHub token for secure artifact access.
- Cross-Platform Support: Can be adapted for different operating systems and environments.
By integrating TestDriver with the runner artifact URL and GitHub token, this workflow ensures seamless testing of your application builds.