From 2929b99160bd2d6ccb1a27310b55bd98028c1f20 Mon Sep 17 00:00:00 2001 From: Alexey Solodkiy Date: Tue, 1 Oct 2024 09:32:08 +0300 Subject: [PATCH] Add e2e to ci --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 406d3f7..789bdd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,3 +74,42 @@ jobs: asset_path: gauge-exporter asset_name: gauge-exporter asset_content_type: application/octet-stream + + e2e_test: + name: E2E Tests + runs-on: ubuntu-latest + needs: [compile] # Ensure release only happens after compile + + steps: + - uses: actions/checkout@v3 + + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: gauge-exporter + + - name: Make gauge-exporter executable + run: chmod +x ./e2e_tests/gauge-exporter + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + + - name: Cache Composer packages + uses: actions/cache@v3 + with: + path: e2e_tests/vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/e2e_tests/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: | + cd e2e_tests + composer install --prefer-dist -n --no-ansi + + - name: Run E2E tests + run: | + cd e2e_tests + ./vendor/bin/phpunit --testdox