|
25 | 25 | push: |
26 | 26 | paths: |
27 | 27 | - "backend/**" |
| 28 | + - "tools/e2e_test/**" |
28 | 29 | - ".tool-versions" |
29 | 30 | - ".github/workflows/backend-test.yaml" |
30 | 31 | branches: |
|
34 | 35 | pull_request: |
35 | 36 | paths: |
36 | 37 | - "backend/**" |
| 38 | + - "tools/e2e_test/**" |
37 | 39 | - ".tool-versions" |
38 | 40 | - ".github/workflows/backend-test.yaml" |
39 | 41 |
|
@@ -280,4 +282,59 @@ jobs: |
280 | 282 | steps: |
281 | 283 | - uses: actions/checkout@v5 |
282 | 284 | - name: Build Docker image |
283 | | - run: docker build . |
| 285 | + run: docker build . -t edgehogdevicemanager/edgehog-backend:latest |
| 286 | + - uses: ./.github/actions/export-container |
| 287 | + |
| 288 | + e2e-test: |
| 289 | + name: End to end |
| 290 | + runs-on: ubuntu-24.04 |
| 291 | + needs: build-docker-image |
| 292 | + env: |
| 293 | + CARGO_TERM_COLOR: always |
| 294 | + SCCACHE_GHA_ENABLED: "true" |
| 295 | + RUSTC_WRAPPER: "sccache" |
| 296 | + RUST_LOG: "debug" |
| 297 | + steps: |
| 298 | + - name: Checkout repository |
| 299 | + uses: actions/checkout@v5 |
| 300 | + with: |
| 301 | + show-progress: false |
| 302 | + - name: Setup Rust toolchain |
| 303 | + uses: actions-rust-lang/setup-rust-toolchain@v1.15.2 |
| 304 | + - uses: mozilla-actions/sccache-action@v0.0.9 |
| 305 | + - uses: extractions/setup-just@v3 |
| 306 | + - name: Install astartectl |
| 307 | + uses: jaxxstorm/action-install-gh-release@v1.10.0 |
| 308 | + with: |
| 309 | + repo: astarte-platform/astartectl |
| 310 | + # Cache astarte docker images |
| 311 | + - name: Cache Docker images. |
| 312 | + uses: ScribeMD/docker-cache@0.5.0 |
| 313 | + with: |
| 314 | + key: docker-${{ runner.os }} |
| 315 | + - name: Init Astarte repo |
| 316 | + shell: bash |
| 317 | + run: | |
| 318 | + just _check-system-prereqs _check-astarte-prereqs _configure-system _init-astarte |
| 319 | + - uses: ./.github/actions/import-container |
| 320 | + - name: Init edgehog |
| 321 | + run: | |
| 322 | + docker compose up -d |
| 323 | + - name: Provision astarte realm |
| 324 | + timeout-minutes: 2 |
| 325 | + run: | |
| 326 | + just _wait-astarte _create-astarte-realm |
| 327 | + # Skipping `_wait-for-edgehog`: the previous step should be way longer |
| 328 | + # than what is needed. |
| 329 | + - name: Provision edgehog tenant |
| 330 | + timeout-minutes: 2 |
| 331 | + run: | |
| 332 | + just _create-edgehog-tenant |
| 333 | + - name: Check containers |
| 334 | + if: ${{ failure() }} |
| 335 | + run: | |
| 336 | + docker compose logs |
| 337 | + - name: Run e2e test suite |
| 338 | + working-directory: tools/e2e_test |
| 339 | + run: | |
| 340 | + cargo test |
0 commit comments