From 1379ece7a23d4ff94645dbbb2207d64beb580754 Mon Sep 17 00:00:00 2001 From: Sudip Bhattarai Date: Tue, 21 May 2024 13:12:02 +0545 Subject: [PATCH 1/3] Fix test workflows --- .github/workflows/test_backend.yml | 2 +- .../workflows/test_integration_cypress.yml | 71 ------------------- 2 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 .github/workflows/test_integration_cypress.yml diff --git a/.github/workflows/test_backend.yml b/.github/workflows/test_backend.yml index 6254cef48..ea084fc61 100644 --- a/.github/workflows/test_backend.yml +++ b/.github/workflows/test_backend.yml @@ -115,5 +115,5 @@ jobs: target-folder: ${{ env.REPORT_NAME }} env: - REPORT_NAME: backend + REPORT_NAME: govtool-backend GH_PAGES: ${{vars.GH_PAGES}} diff --git a/.github/workflows/test_integration_cypress.yml b/.github/workflows/test_integration_cypress.yml deleted file mode 100644 index f6f5d554b..000000000 --- a/.github/workflows/test_integration_cypress.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Integration Test [Cypress] -run-name: Integration Test on ${{ inputs.network ||'sanchonet' }} [${{ inputs.deployment || 'staging.govtool.byron.network' }}] - -on: - push: - branches: [feat/integration-test] - schedule: - - cron: '0 0 * * *' - - workflow_dispatch: - inputs: - network: - required: true - type: choice - default: "sanchonet" - options: - - "sanchonet" - deployment: - required: true - type: choice - default: "staging.govtool.byron.network" - options: - - "sanchogov.tools" - - "staging.govtool.byron.network" - - "govtool-sanchonet.cardanoapi.io" - -jobs: - cypress-tests: - defaults: - run: - working-directory: ./tests/govtool-frontend - runs-on: ubuntu-latest - env: - NODE_OPTIONS: --max_old_space_size=4096 - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v3 - id: yarn-cache - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: - ${{ runner.os }}-yarn-${{hashFiles('tests/govtool-frontend/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Cypress run - uses: cypress-io/github-action@v6 - with: - record: true - working-directory: ./tests/govtool-frontend - env: - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - # pass GitHub token to allow accurately detecting a build vs a re-run build - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_baseUrl: https://${{inputs.deployment || 'staging.govtool.byron.network' }} - CYPRESS_apiUrl: https://${{ inputs.deployment || 'staging.govtool.byron.network' }}/api - CYPRESS_kuberApiUrl: https://${{ inputs.network || 'sanchonet' }}.kuber.cardanoapi.io - CYPRESS_kuberApiKey: ${{secrets.KUBER_API_KEY}} - CYPRESS_faucetApiUrl: https://faucet.${{inputs.network || 'sanchonet'}}.world.dev.cardano.org - CYPRESS_faucetApiKey: ${{ secrets.FAUCET_API_KEY }} From ac7015e438a4305c1d461c574bfb6a88c58dc761 Mon Sep 17 00:00:00 2001 From: Sudip Bhattarai Date: Tue, 21 May 2024 14:06:48 +0545 Subject: [PATCH 2/3] Fix backend workflow variables --- .github/workflows/test_backend.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_backend.yml b/.github/workflows/test_backend.yml index ea084fc61..1a7deea44 100644 --- a/.github/workflows/test_backend.yml +++ b/.github/workflows/test_backend.yml @@ -33,15 +33,15 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + python ./setup.py python -m pytest --alluredir allure-results env: - BASE_URL: https://${{inputs.deployment || 'staging.govtool.byron.network/api' }} - METRICS_URL: https://metrics.cardanoapi.io - METRICS_API_SECRET: "${{ secrets.METRICS_SERVER_SECRET_TOKEN }}" + BASE_URL: https://${{inputs.deployment || 'govtool.cardanoapi.io/api' }} + FAUCET_API_KEY: ${{ secrets.FAUCET_API_KEY }} + KUBER_API_URL: https://kuber-govtool.cardanoapi.io - name: Upload report uses: actions/upload-artifact@v3 - if: always() with: name: allure-results path: tests/govtool-backend/allure-results @@ -89,7 +89,6 @@ jobs: - name: Build report uses: simple-elf/allure-report-action@master - if: always() id: allure-report with: allure_results: allure-results From 526021c49c340222be574ec4ae7ff2fd45ea8816 Mon Sep 17 00:00:00 2001 From: Sudip Bhattarai Date: Tue, 21 May 2024 14:14:15 +0545 Subject: [PATCH 3/3] Add manual trigger lighthouse workflow trigger --- .github/workflows/lighthouse.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml index 213d2fdf8..1b24b16d1 100644 --- a/.github/workflows/lighthouse.yml +++ b/.github/workflows/lighthouse.yml @@ -6,6 +6,7 @@ on: - Build and deploy GovTool test stack types: - completed + workflow_dispatch: jobs: lighthouse: @@ -34,4 +35,6 @@ jobs: if: github.repository_owner == 'IntersectMBO' run: | lhci assert --preset lighthouse:recommended || echo "LightHouse Assertion error ignored ..." - lhci upload --githubAppToken="${{ secrets.LHCI_GITHUB_APP_TOKEN }}" --token="${{ secrets.LHCI_SERVER_TOKEN }}" --serverBaseUrl=https://lighthouse-govtool.cardanoapi.io --ignoreDuplicateBuildFailure + lhci upload --githubAppToken="${{ secrets.LHCI_GITHUB_APP_TOKEN }}" --token="${{ secrets.LHCI_SERVER_TOKEN }}" --serverBaseUrl=${LHCI_SERVER_URL} --ignoreDuplicateBuildFailure + env: + LHCI_SERVER_URL: https://lighthouse-govtool.cardanoapi.io