|
| 1 | +# |
| 2 | +# This file is part of Edgehog. |
| 3 | +# |
| 4 | +# Copyright 2025 SECO Mind Srl |
| 5 | +# |
| 6 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +# you may not use this file except in compliance with the License. |
| 8 | +# You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, software |
| 13 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +# See the License for the specific language governing permissions and |
| 16 | +# limitations under the License. |
| 17 | +# |
| 18 | +# SPDX-License-Identifier: Apache-2.0 |
| 19 | +# |
| 20 | + |
| 21 | +name: End to end test |
| 22 | + |
| 23 | +on: |
| 24 | + # Run when pushing to stable branches |
| 25 | + push: |
| 26 | + paths: |
| 27 | + - "backend/**" |
| 28 | + - "tools/e2e_test/**" |
| 29 | + - ".tool-versions" |
| 30 | + - ".github/workflows/e2e-test.yaml" |
| 31 | + branches: |
| 32 | + - "main" |
| 33 | + - "release-*" |
| 34 | + # Run on pull requests matching apps |
| 35 | + pull_request: |
| 36 | + paths: |
| 37 | + - "backend/**" |
| 38 | + - "tools/e2e_test/**" |
| 39 | + - ".tool-versions" |
| 40 | + - ".github/workflows/e2e-test.yaml" |
| 41 | + |
| 42 | +defaults: |
| 43 | + run: |
| 44 | + shell: bash |
| 45 | + working-directory: tools/e2e_test |
| 46 | +env: |
| 47 | + EDGEHOG_TEST_TENANT: "test" |
| 48 | + EDGEHOG_TEST_HOSTNAME: "api.edgehog.localhost" |
| 49 | + EDGEHOG_TEST_BEARER: "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJlX3RnYSI6IioiLCJpYXQiOjE3Mzg5NDgzODh9.TTiXYs1LucAnS_6RGp7pWg-S30NSt7eqL7lU8BzT5BWlHctk7NYZwC6lftA6WeEb1HKEJfPoUqWeOeZ6oYA0AA" |
| 50 | + |
| 51 | +jobs: |
| 52 | + e2e-test: |
| 53 | + name: End to end |
| 54 | + runs-on: ubuntu-24.04 |
| 55 | + steps: |
| 56 | + - name: Checkout repository |
| 57 | + uses: actions/checkout@v5 |
| 58 | + with: |
| 59 | + show-progress: false |
| 60 | + - name: Install gleam and BEAM |
| 61 | + uses: erlef/setup-beam@v1 |
| 62 | + with: |
| 63 | + otp-version: "28" |
| 64 | + gleam-version: "1.13.0" |
| 65 | + rebar3-version: "3" |
| 66 | + - uses: mozilla-actions/sccache-action@v0.0.9 |
| 67 | + - name: Setup `just` |
| 68 | + uses: extractions/setup-just@v3 |
| 69 | + with: |
| 70 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + - name: Install astartectl |
| 72 | + uses: jaxxstorm/action-install-gh-release@v1.10.0 |
| 73 | + with: |
| 74 | + repo: astarte-platform/astartectl |
| 75 | + - name: Provision a tenant |
| 76 | + run: just provision-tenant |
| 77 | + - name: Run e2e test suite |
| 78 | + run: | |
| 79 | + gleam run |
0 commit comments