Skip to content

Commit

Permalink
Merge pull request PrestaShop#35049 from Progi1984/nightlyMaxParallel
Browse files Browse the repository at this point in the history
Nightly : Externalize Push Reports & Define the maximum number of concurrent jobs
  • Loading branch information
Progi1984 authored Jan 16, 2024
2 parents 712ba74 + 9ce5c01 commit 91e2953
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 38 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cron_nightly_tests_1.7.8.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ jobs:
secrets:
GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }}
GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }}
API_NIGHTLY_IMPORT_TOKEN: ${{ secrets.NIGHTLY_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/cron_nightly_tests_8.0.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ jobs:
secrets:
GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }}
GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }}
API_NIGHTLY_IMPORT_TOKEN: ${{ secrets.NIGHTLY_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/cron_nightly_tests_8.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ jobs:
secrets:
GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }}
GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }}
API_NIGHTLY_IMPORT_TOKEN: ${{ secrets.NIGHTLY_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/cron_nightly_tests_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ jobs:
secrets:
GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }}
GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }}
API_NIGHTLY_IMPORT_TOKEN: ${{ secrets.NIGHTLY_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/cron_nightly_tests_reports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow aim to run all UI tests on active branches
# and upload the report on Google cloud platform storage
name: Nightly tests (Report)

on:
schedule:
- cron: '0 5 * * *'
workflow_dispatch:

jobs:
# Add pushed reports to GCP on nightly
push-nightly-reports:
name: Push reports to nightly.prestashop-project.org
runs-on: ubuntu-latest

strategy:
fail-fast: false
max-parallel: 1
matrix:
BRANCH:
- 1.7.8.x
- 8.0.x
- 8.1.x
- develop

steps:
- name: Push reports
run: |
REPORT_NAME="$(date +%Y-%m-%d)-${{ matrix.branch }}"
curl -v "https://api-nightly.prestashop-project.org/hook/reports/import?token=${{ secrets.NIGHTLY_TOKEN }}&filename=${REPORT_NAME}.json"
35 changes: 1 addition & 34 deletions .github/workflows/cron_nightly_tests_reusable.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow aim to run all UI tests on active branches
# and upload the report on Google cloud platform storage
name: Nightly tests and report
name: Nightly tests (Run & Upload)

on:
workflow_call:
Expand All @@ -16,11 +16,6 @@ on:
required: false
type: string
default: '14'
API_NIGHTLY_IMPORT_HOOK:
description: 'Nightly hook to import report'
required: false
type: string
default: 'https://api-nightly.prestashop-project.org/hook/reports/import'
TESTS_DIR:
description: 'Where UI tests are'
required: false
Expand All @@ -33,9 +28,6 @@ on:
## GCP Service Key
GC_SERVICE_KEY:
required: true
## Nightly token to validate the import
API_NIGHTLY_IMPORT_TOKEN:
required: true

permissions:
contents: read
Expand Down Expand Up @@ -273,28 +265,3 @@ jobs:

- name: Upload to Google Cloud Storage (GCS)
run: gsutil cp -r "${{ env.COMBINED_REPORT_DIR }}/**" gs://prestashop-core-nightly/reports

# Add pushed reports to GCP on nightly
push-nightly-reports:
permissions:
contents: none
name: Push reports to nightly.prestashop-project.org
if: ${{ always() }}
needs:
- merge-upload-reports
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
BRANCH:
- ${{ inputs.BRANCH }}

env:
GH_BRANCH: ${{ matrix.branch }}

steps:
- name: Push reports
run: |
REPORT_NAME="$(date +%Y-%m-%d)-${{ env.GH_BRANCH }}"
curl -v "${{ inputs.API_NIGHTLY_IMPORT_HOOK }}?token=${{ secrets.API_NIGHTLY_IMPORT_TOKEN }}&filename=${REPORT_NAME}.json"

0 comments on commit 91e2953

Please sign in to comment.