diff --git a/.github/workflows/cron-main-e2e.yml b/.github/workflows/cron-main-e2e.yml new file mode 100644 index 00000000..f27994bd --- /dev/null +++ b/.github/workflows/cron-main-e2e.yml @@ -0,0 +1,39 @@ +name: daily-e2e.yml +on: + schedule: + - cron: '0 8 * * *' + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: "Checkout" + uses: actions/checkout@v4 + with: + ref: main + + - name: "Build test containers" + run: docker compose build 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 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_ENDPOINT: ${{ secrets.RP_ENDPOINT }} + RP_API_KEY: ${{ secrets.RP_API_KEY }} + + - name: "Stop containers" + if: always() + run: docker compose down diff --git a/.github/workflows/pr-build-merge.yml b/.github/workflows/pr-build-merge.yml index aa18edaf..f9592066 100644 --- a/.github/workflows/pr-build-merge.yml +++ b/.github/workflows/pr-build-merge.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - name: "Build test containers" - run: docker compose build app_test + run: docker compose build app_test e2e - name: "Create environment file" run: env | grep -E '^MPT_' > .env @@ -41,7 +41,7 @@ jobs: run: docker compose run --service-ports app_test - name: "Run E2E test" - run: docker compose run --service-ports app_test 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" + 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_ENDPOINT: ${{ secrets.RP_ENDPOINT }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41ba86ce..bdd362b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,27 @@ jobs: with: fetch-depth: 0 + - name: "Build test containers" + run: docker compose build 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 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_ENDPOINT: ${{ secrets.RP_ENDPOINT }} + RP_API_KEY: ${{ secrets.RP_API_KEY }} + - name: "Set up Python" uses: actions/setup-python@v5 with: