Periodic: Test Linux Cloud VM #802
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: "Periodic: Test Linux Cloud VM" | |
| on: | |
| schedule: | |
| - cron: "7/15 * * * *" | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - examples/sandboxes/test_linux_cloud_vm.py | |
| jobs: | |
| test: | |
| name: Test Linux Cloud VM (${{ matrix.secret_name }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| secret_name: | |
| - PERIODIC_TEST_CUA_API_KEY | |
| - PERIODIC_TEST_CUA_API_KEY_BASALT | |
| steps: | |
| - name: Checkout latest main | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| ref: main | |
| - name: Create test branch | |
| run: git checkout -b periodic-test/${{ matrix.secret_name }}/${{ github.run_id }} | |
| - name: Set up Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip install cua pytest pytest-asyncio | |
| - name: Run test | |
| run: python -m pytest examples/sandboxes/test_linux_cloud_vm.py | |
| env: | |
| CUA_API_KEY: ${{ secrets[matrix.secret_name] }} | |
| - name: Alert Alertmanager on failure | |
| if: failure() | |
| run: | | |
| curl -s -X POST https://am.cua.ai/api/v2/alerts \ | |
| -H 'Content-Type: application/json' \ | |
| -d '[{ | |
| "labels": { | |
| "alertname": "PeriodicTestLinuxCloudVMFailed", | |
| "severity": "critical", | |
| "service": "cua-sdk", | |
| "job": "periodic-test-linux-cloud-vm", | |
| "secret": "${{ matrix.secret_name }}" | |
| }, | |
| "annotations": { | |
| "summary": "Periodic Linux Cloud VM test failed (${{ matrix.secret_name }})", | |
| "description": "GitHub Actions workflow \"Periodic: Test Linux Cloud VM\" failed for ${{ matrix.secret_name }}. Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | |
| "dashboard": "https://github.com/${{ github.repository }}/actions/workflows/periodic-test-linux-cloud-vm.yml" | |
| }, | |
| "generatorURL": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| }]' |