feat: add generalized cli_args input to action, move CLI docs to CLI.… #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test OpenHands AI Action | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'action.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'action.yml' | |
| workflow_dispatch: | |
| jobs: | |
| test-action: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Test OpenHands AI Action with valid API key | |
| id: openhands_valid | |
| uses: ./ | |
| with: | |
| prompt: Create a markdown file hello.md containing the text hello world | |
| llm_api_key: ${{ secrets.LLM_API_KEY }} | |
| log_all_events: "true" | |
| - name: Verify file creation and content | |
| run: | | |
| if [ ! -f "hello.md" ]; then | |
| echo "Error: hello.md file was not created" | |
| exit 1 | |
| fi | |
| if ! grep -q "hello world" "hello.md"; then | |
| echo "Error: hello.md does not contain 'hello world'" | |
| echo "File contents:" | |
| cat "hello.md" | |
| exit 1 | |
| fi | |
| echo "Success: hello.md was created and contains 'hello world'" | |
| - name: Test OpenHands AI Action without API key | |
| id: openhands_invalid | |
| continue-on-error: true | |
| uses: ./ | |
| with: | |
| prompt: Create a markdown file test.md containing the text test | |
| log_all_events: "true" | |
| - name: Verify error without API key | |
| run: | | |
| if [ "${{ steps.openhands_invalid.outcome }}" != "failure" ]; then | |
| echo "Error: Action should have failed without API key" | |
| exit 1 | |
| fi |