diff --git a/.github/workflows/cron-main-e2e.yml b/.github/workflows/cron-main-e2e.yml index a132189d..ffeca7f3 100644 --- a/.github/workflows/cron-main-e2e.yml +++ b/.github/workflows/cron-main-e2e.yml @@ -6,7 +6,7 @@ on: jobs: build: runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 steps: - name: "Checkout" uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: - name: "Run E2E test" run: docker compose run --service-ports e2e bash -c "pytest -v -p no:randomly --no-cov --reportportal --rp-launch=$RP_LAUNCH --rp-api-key=$RP_API_KEY --rp-endpoint=$RP_ENDPOINT --junitxml=e2e-report.xml tests/e2e" env: - RP_LAUNCH: github-e2e-cron-main + RP_LAUNCH: github-e2e-cron-${{ github.ref_name }} RP_ENDPOINT: ${{ secrets.RP_ENDPOINT }} RP_API_KEY: ${{ secrets.RP_API_KEY }} diff --git a/.github/workflows/pr-build-merge.yml b/.github/workflows/pull-request.yml similarity index 82% rename from .github/workflows/pr-build-merge.yml rename to .github/workflows/pull-request.yml index 703c96e9..8557982c 100644 --- a/.github/workflows/pr-build-merge.yml +++ b/.github/workflows/pull-request.yml @@ -3,10 +3,6 @@ name: PR build and merge on: pull_request: types: [opened, synchronize, reopened] - push: - branches: - - main - - "release/**" permissions: contents: read @@ -15,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 steps: - name: "Checkout" @@ -41,9 +37,9 @@ jobs: run: docker compose run --service-ports app_test - name: "Run E2E test" - run: docker compose run --service-ports e2e bash -c "pytest -v -p no:randomly --no-cov --junitxml=e2e-report.xml tests/e2e" + run: docker compose run --service-ports e2e bash -c "pytest -v -p no:randomly --no-cov --reportportal --rp-launch=$RP_LAUNCH --rp-api-key=$RP_API_KEY --rp-endpoint=$RP_ENDPOINT --junitxml=e2e-report.xml tests/e2e" env: - RP_LAUNCH: github-e2e-test + RP_LAUNCH: github-e2e-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_number }} RP_ENDPOINT: ${{ secrets.RP_ENDPOINT }} RP_API_KEY: ${{ secrets.RP_API_KEY }} diff --git a/.github/workflows/push-release-branch.yml b/.github/workflows/push-release-branch.yml new file mode 100644 index 00000000..a1627856 --- /dev/null +++ b/.github/workflows/push-release-branch.yml @@ -0,0 +1,57 @@ +name: PR build and merge + +on: + push: + branches: + - main + - "release/**" + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + timeout-minutes: 45 + + steps: + - name: "Checkout" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "Build test containers" + run: docker compose build app_test e2e + + - name: "Create environment file" + run: env | grep -E '^MPT_' > .env + env: + RP_ENDPOINT: ${{ secrets.RP_ENDPOINT }} + RP_API_KEY: ${{ secrets.RP_API_KEY }} + MPT_API_BASE_URL: ${{ secrets.MPT_API_BASE_URL }} + MPT_API_TOKEN: ${{ secrets.MPT_API_TOKEN }} + MPT_API_TOKEN_CLIENT: ${{ secrets.MPT_API_TOKEN_CLIENT }} + MPT_API_TOKEN_OPERATIONS: ${{ secrets.MPT_API_TOKEN_OPERATIONS }} + MPT_API_TOKEN_VENDOR: ${{ secrets.MPT_API_TOKEN_VENDOR }} + + - name: "Run validation & test" + run: docker compose run --service-ports app_test + + - name: "Run E2E test" + run: docker compose run --service-ports e2e bash -c "pytest -v -p no:randomly --no-cov --reportportal --rp-launch=$RP_LAUNCH --rp-api-key=$RP_API_KEY --rp-endpoint=$RP_ENDPOINT --junitxml=e2e-report.xml tests/e2e" + env: + RP_LAUNCH: github-e2e-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_number }} + RP_ENDPOINT: ${{ secrets.RP_ENDPOINT }} + RP_API_KEY: ${{ secrets.RP_API_KEY }} + + + - name: "Run SonarCloud Scan" + uses: SonarSource/sonarqube-scan-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: "Stop containers" + if: always() + run: docker compose down diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 094426cd..38cfa151 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: build: runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 steps: - name: "Checkout"