Use POST for integration add-multiple commands #125
Workflow file for this run
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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| python-version: | |
| description: 'Python version to test' | |
| required: false | |
| default: '3.14' | |
| type: choice | |
| options: | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| - '3.14' | |
| pull_request: | |
| branches: | |
| - staging | |
| - main | |
| paths: | |
| - 'cortexapps_cli/**' | |
| - 'tests/**' | |
| env: | |
| AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | |
| CORTEX_API_KEY: ${{ secrets.CORTEX_API_KEY }} | |
| CORTEX_API_KEY_VIEWER: ${{ secrets.CORTEX_API_KEY_VIEWER }} | |
| CORTEX_BASE_URL: ${{ vars.CORTEX_BASE_URL }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["${{ inputs.python-version || '3.14' }}"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Display Python version | |
| run: python -c "import sys; print(sys.version)" | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update && sudo apt install just | |
| python -m pip install --upgrade pip | |
| pip install poetry "poetry-audit-plugin" "safety<3.8.0" pytest-cov pytest pytest-xdist | |
| - name: Run pip-audit to check for vulnerabilities | |
| run: poetry audit | |
| - name: Create and populate .cortex/config file | |
| run: | | |
| mkdir $HOME/.cortex | |
| echo "[default]" > $HOME/.cortex/config | |
| echo "api_key = $CORTEX_API_KEY" >> $HOME/.cortex/config | |
| echo "base_url = $CORTEX_BASE_URL" >> $HOME/.cortex/config | |
| shell: bash | |
| - name: Install package | |
| run: | | |
| poetry build | |
| poetry install | |
| - name: Test with pytest | |
| run: | | |
| just test-all | |
| automerge: | |
| needs: test | |
| # Only auto-merge on non-draft PRs. For PRs requiring human review, keep as | |
| # draft until approved, then convert to ready — that re-triggers this workflow. | |
| if: github.event_name == 'pull_request' && github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - name: Auto-merge PR | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh pr merge ${{ github.event.pull_request.number }} --merge --auto --repo ${{ github.repository }} || true |