|
| 1 | +name: CI |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + |
| 6 | +concurrency: |
| 7 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 8 | + cancel-in-progress: true |
| 9 | + |
| 10 | +on: |
| 11 | + workflow_dispatch: {} |
| 12 | + pull_request: |
| 13 | + push: |
| 14 | + branches: [main] |
| 15 | + |
| 16 | +jobs: |
| 17 | + changes: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + outputs: |
| 20 | + agentstack-server: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.agentstack-server == 'true' }} |
| 21 | + agentstack-cli: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.agentstack-cli == 'true' }} |
| 22 | + agentstack-sdk-py: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.agentstack-sdk-py == 'true' }} |
| 23 | + helm: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.helm == 'true' }} |
| 24 | + examples: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.examples == 'true' }} |
| 25 | + microshift-vm: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.microshift-vm == 'true' }} |
| 26 | + steps: |
| 27 | + - uses: dorny/paths-filter@668c092af3649c4b664c54e4b704aa46782f6f7c |
| 28 | + id: filter |
| 29 | + with: |
| 30 | + filters: | |
| 31 | + agentstack-server: 'apps/agentstack-server/**' |
| 32 | + agentstack-cli: 'apps/agentstack-cli/**' |
| 33 | + agentstack-sdk-py: 'apps/agentstack-sdk-py/**' |
| 34 | + helm: 'helm/**' |
| 35 | + examples: 'examples/**' |
| 36 | + microshift-vm: 'apps/microshift-vm/**' |
| 37 | +
|
| 38 | + check: |
| 39 | + name: mise check |
| 40 | + runs-on: ubuntu-latest |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 43 | + - uses: ./.github/actions/setup |
| 44 | + env: |
| 45 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + - run: mise run check |
| 47 | + |
| 48 | + test: |
| 49 | + name: mise test |
| 50 | + runs-on: ubuntu-latest |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 53 | + - uses: ./.github/actions/setup |
| 54 | + env: |
| 55 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 56 | + - run: mise run test |
| 57 | + |
| 58 | + microshift-vm-build: |
| 59 | + name: mise microshift-vm:build:qemu |
| 60 | + needs: changes |
| 61 | + if: needs.changes.outputs.microshift-vm == 'true' |
| 62 | + timeout-minutes: 10 |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 66 | + - name: Set arch |
| 67 | + run: echo "ARCH=$(uname -m | sed -e 's/arm64/aarch64/;s/amd64/x86_64/')" >> $GITHUB_ENV |
| 68 | + - id: cache-check |
| 69 | + uses: actions/cache@565629816435f6c0b50676926c9b05c254113c0c |
| 70 | + with: |
| 71 | + path: apps/microshift-vm/dist/${{ env.ARCH }} |
| 72 | + key: microshift-vm-dist-v1-${{ runner.os }}-${{ env.ARCH }}-${{ hashFiles('apps/microshift-vm/**') }} |
| 73 | + lookup-only: true |
| 74 | + - if: steps.cache-check.outputs.cache-hit != 'true' |
| 75 | + uses: ./.github/actions/setup |
| 76 | + with: |
| 77 | + install_vm_deps: 'build' |
| 78 | + - if: steps.cache-check.outputs.cache-hit != 'true' |
| 79 | + run: mise run microshift-vm:build:qemu |
| 80 | + |
| 81 | + agentstack-server-test-integration: |
| 82 | + name: mise agentstack-server:test:integration |
| 83 | + needs: [changes, microshift-vm-build] |
| 84 | + if: >- |
| 85 | + always() && |
| 86 | + needs.microshift-vm-build.result != 'failure' && |
| 87 | + (needs.changes.outputs.agentstack-server == 'true' || |
| 88 | + needs.changes.outputs.agentstack-cli == 'true') |
| 89 | + timeout-minutes: 25 |
| 90 | + runs-on: ubuntu-latest |
| 91 | + steps: |
| 92 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 93 | + - uses: ./.github/actions/setup |
| 94 | + with: |
| 95 | + maximize_space: 'true' |
| 96 | + install_vm_deps: 'run' |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + - run: mise run agentstack-server:test:integration |
| 100 | + env: |
| 101 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 102 | + LLM_API_BASE: "${{ secrets.OPENAI_API_BASE }}" |
| 103 | + LLM_MODEL: "${{ vars.OPENAI_MODEL }}" |
| 104 | + LLM_API_KEY: "${{ secrets.OPENAI_API_KEY }}" |
| 105 | + |
| 106 | + agentstack-server-test-e2e: |
| 107 | + name: mise agentstack-server:test:e2e |
| 108 | + needs: [changes, microshift-vm-build] |
| 109 | + if: >- |
| 110 | + always() && |
| 111 | + needs.microshift-vm-build.result != 'failure' && |
| 112 | + (needs.changes.outputs.agentstack-server == 'true' || |
| 113 | + needs.changes.outputs.agentstack-cli == 'true' || |
| 114 | + needs.changes.outputs.agentstack-sdk-py == 'true' || |
| 115 | + needs.changes.outputs.helm == 'true') |
| 116 | + timeout-minutes: 25 |
| 117 | + runs-on: ubuntu-latest |
| 118 | + env: |
| 119 | + AGENTSTACK__HOME: ${{ github.workspace }}/.agentstack |
| 120 | + steps: |
| 121 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 122 | + - uses: ./.github/actions/setup |
| 123 | + with: |
| 124 | + maximize_space: 'true' |
| 125 | + install_vm_deps: 'run' |
| 126 | + env: |
| 127 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 128 | + - run: mise run agentstack-server:test:e2e |
| 129 | + env: |
| 130 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 131 | + LLM_API_BASE: "${{ secrets.OPENAI_API_BASE }}" |
| 132 | + LLM_MODEL: "${{ vars.OPENAI_MODEL }}" |
| 133 | + EMBEDDING_MODEL: "${{ vars.OPENAI_EMBEDDING_MODEL }}" |
| 134 | + LLM_API_KEY: "${{ secrets.OPENAI_API_KEY }}" |
| 135 | + |
| 136 | + agentstack-server-test-e2e-examples: |
| 137 | + name: mise agentstack-server:test:e2e-examples |
| 138 | + needs: [changes, microshift-vm-build] |
| 139 | + if: >- |
| 140 | + always() && |
| 141 | + needs.microshift-vm-build.result != 'failure' && |
| 142 | + (needs.changes.outputs.agentstack-server == 'true' || |
| 143 | + needs.changes.outputs.agentstack-sdk-py == 'true' || |
| 144 | + needs.changes.outputs.examples == 'true' || |
| 145 | + needs.changes.outputs.helm == 'true') && |
| 146 | + (github.event_name != 'pull_request' || |
| 147 | + contains(github.event.pull_request.labels.*.name, 'e2e-examples')) |
| 148 | + timeout-minutes: 45 |
| 149 | + runs-on: ubuntu-latest |
| 150 | + env: |
| 151 | + AGENTSTACK__HOME: ${{ github.workspace }}/.agentstack |
| 152 | + steps: |
| 153 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 154 | + - uses: ./.github/actions/setup |
| 155 | + with: |
| 156 | + maximize_space: 'true' |
| 157 | + install_vm_deps: 'run' |
| 158 | + env: |
| 159 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 160 | + - run: mise run agentstack-server:test:e2e-examples |
| 161 | + env: |
| 162 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 163 | + LLM_API_BASE: "${{ secrets.OPENAI_API_BASE }}" |
| 164 | + LLM_MODEL: "${{ vars.OPENAI_MODEL }}" |
| 165 | + EMBEDDING_MODEL: "${{ vars.OPENAI_EMBEDDING_MODEL }}" |
| 166 | + LLM_API_KEY: "${{ secrets.OPENAI_API_KEY }}" |
| 167 | + |
| 168 | + agentstack-sdk-py-test-all: |
| 169 | + name: "mise agentstack-sdk-py:test-all --python=${{ matrix.python }}" |
| 170 | + needs: changes |
| 171 | + if: needs.changes.outputs.agentstack-sdk-py == 'true' |
| 172 | + runs-on: ubuntu-latest |
| 173 | + strategy: |
| 174 | + fail-fast: false |
| 175 | + matrix: |
| 176 | + python: |
| 177 | + - "3.11" |
| 178 | + - "3.14" |
| 179 | + steps: |
| 180 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 181 | + - uses: ./.github/actions/setup |
| 182 | + with: |
| 183 | + install_vm_deps: 'run' |
| 184 | + env: |
| 185 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 186 | + - run: mise run agentstack-sdk-py:test-all --python=${{ matrix.python }} |
0 commit comments