This action is specifically designed to be used as a shared/reusable action from external repositories. All implementation details are self-contained within the action.yaml file, with no dependencies on external script files that could cause path resolution issues.
When a GitHub Action is called from an external repository (e.g., uses: opencord/shared-workflows/.github/actions/bbsim-tests@master), the action runs in the context of the calling repository, not the action's repository. This means:
./execute_test.sh won't work${{ github.action_path }}/script.sh may not be accessible/tmp work perfectly# This DOES NOT work from external repositories - name: Execute test shell: bash run: | bash ${{ github.action_path }}/execute_test.sh
When called from opencord/bbsim repository, github.action_path points to a directory that doesn't exist in the caller's context.
# This WORKS from external repositories - name: Create test execution script shell: bash run: | cat > /tmp/execute_test.sh <<'SCRIPT' #!/bin/bash # ... entire script embedded here ... SCRIPT chmod +x /tmp/execute_test.sh - name: Execute test shell: bash run: | bash /tmp/execute_test.sh
The script is created dynamically at runtime, ensuring it's always available regardless of where the action is called from.
name: BBSim Tests on: push: branches: [master] jobs: test: runs-on: ubuntu-latest steps: - name: Run BBSim Tests uses: opencord/shared-workflows/.github/actions/bbsim-tests@master with: branch: master test-targets: | - target: functional-single-kind-dt workflow: dt flags: "" teardown: true logging: true vgcEnabled: false
No special steps required! The action handles everything automatically.
The calling repository needs:
The calling repository does NOT need:
shared-workflows repository checked out locallyWhen the action runs, it automatically checks out these repositories into the runner's workspace:
The calling repository is not automatically checked out. If you need files from your repository, add a checkout step:
steps: - name: Checkout calling repository uses: actions/checkout@v4 with: path: my-repo - name: Run BBSim Tests uses: opencord/shared-workflows/.github/actions/bbsim-tests@master with: branch: master test-targets: | ...
When the action runs, the file system looks like this:
/home/runner/work/
└── <calling-repo-name>/
├── <calling-repo-name>/ (only if explicitly checked out)
├── voltha-system-tests/ (checked out by action)
├── voltha-helm-charts/ (checked out by action, if needed)
├── <gerrit-project>/ (checked out by action, if specified)
├── bin/ (created by action for tools)
├── logs/ (created by action for test results)
└── tmp/
└── execute_test.sh (created by action at runtime)
The action sets these environment variables automatically:
GITHUB_WORKSPACE - Base workspace directoryKUBECONFIG - Kubernetes configuration file locationVOLTCONFIG - VOLTHA CLI configuration locationPATH - Extended with tool directoriesDIAGS_PROFILE - VOLTHA diagnostics profileSSHPASS - ONOS SSH passwordAll test-specific variables are passed to the execution script via environment.
Error: Unable to resolve action 'opencord/shared-workflows/.github/actions/bbsim-tests@master'
Solutions:
Error: Permission denied when running tests
Solutions:
Error: No such file or directory: voltha-system-tests
Solutions:
For production use, always pin to a specific version:
uses: opencord/shared-workflows/.github/actions/bbsim-tests@v1.0.0
uses: opencord/shared-workflows/.github/actions/bbsim-tests@abc123def456...
uses: opencord/shared-workflows/.github/actions/bbsim-tests@master
✅ Portability: Works from any repository without modifications ✅ Self-Contained: No external dependencies to manage ✅ Maintainability: Single file to update (action.yaml) ✅ Testability: Easy to test from different repositories ✅ Security: No risk of path traversal issues ✅ Transparency: All logic visible in one place
See the actual usage in the BBSim repository:
Repository: opencord/bbsim Workflow File: .github/workflows/bbsim-basic-test.yaml
name: BBSim Tests on: push: branches: [master] pull_request: jobs: bbsim-tests: runs-on: ubuntu-latest steps: - name: Run BBSim Tests uses: opencord/shared-workflows/.github/actions/bbsim-tests@master with: branch: master test-targets: | - target: functional-single-kind-dt workflow: dt flags: "" teardown: true logging: true vgcEnabled: false
This works perfectly without any additional setup!
If you're modifying this action:
Unlike Jenkins shared libraries, GitHub Actions composite actions run in the caller's context. This means:
| Jenkins | GitHub Actions |
|---|---|
| Library code runs in shared space | Action code runs in caller's workspace |
| Can reference shared files directly | Must inline or create files at runtime |
@Library('shared') imports | uses: org/repo/.github/actions/name |
| Groovy functions | Composite action steps |
The conversion required embedding all shell script logic directly into the action definition to ensure cross-repository compatibility.
If you encounter issues using this action from your repository:
For bugs or feature requests, open an issue in the shared-workflows repository.