diff --git a/.github/workflows/betelgeuse_dry-run.yml b/.github/workflows/betelgeuse_dry-run.yml deleted file mode 100644 index 8c847c71..00000000 --- a/.github/workflows/betelgeuse_dry-run.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: Betelgeuse Dry-Run for Docstrings Validation - -on: - pull_request: - paths: - - "integration-tests/**" - -jobs: - betelgeuse: - name: "betelgeuse dry-run" - permissions: - contents: read - runs-on: ubuntu-latest - container: - image: fedora:latest - - steps: - - uses: actions/checkout@v4 - - - name: Base setup for Betelgeuse - run: | - dnf --setopt install_weak_deps=False install -y \ - python3-pip - python3 -m pip install betelgeuse - - - name: Run Betelgeuse - run: | - PYTHONPATH=integration-tests/ betelgeuse --config-module \ - custom_betelgeuse_config test-case --dry-run \ - integration-tests/ dryrun_project ./test_case.xml diff --git a/.github/workflows/betelgeuse_test_case_validation_and_upload.yml b/.github/workflows/betelgeuse_test_case_validation_and_upload.yml new file mode 100644 index 00000000..a10ff7db --- /dev/null +++ b/.github/workflows/betelgeuse_test_case_validation_and_upload.yml @@ -0,0 +1,70 @@ +--- +name: Betelgeuse Docstrings Validation and Automated Test Cases Upload +permissions: + contents: read + +on: + pull_request: + paths: + - "integration-tests/**" + schedule: + # Run weekly on Mondays at 2 AM UTC + - cron: '0 2 * * 1' + workflow_dispatch: # Allow manual triggering + +jobs: + betelgeuse-dry-run: + name: "betelgeuse dry-run" + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + container: + image: fedora:latest + + steps: + - uses: actions/checkout@v4 + + - name: Base setup for Betelgeuse + run: | + dnf --setopt install_weak_deps=False install -y \ + python3-pip + python3 -m pip install betelgeuse + + - name: Run Betelgeuse + run: | + PYTHONPATH=integration-tests/ betelgeuse --config-module \ + custom_betelgeuse_config test-case --dry-run \ + integration-tests/ dryrun_project ./test_case.xml + + betelgeuse-upload: + name: "betelgeuse upload to Polarion" + runs-on: ubuntu-latest + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + container: + image: fedora:latest + + steps: + - uses: actions/checkout@v4 + + - name: Base setup for Betelgeuse + run: | + dnf --setopt install_weak_deps=False install -y \ + python3-pip + python3 -m pip install betelgeuse + + - name: Generate test cases XML + env: + POLARION_PROJECT: ${{ secrets.POLARION_PROJECT }} + run: | + PYTHONPATH=integration-tests/ betelgeuse --config-module \ + custom_betelgeuse_config test-case --requirement-lookup-method id \ + integration-tests/ ${{ secrets.POLARION_PROJECT }} ./test_case.xml + + - name: Upload to Polarion + env: + POLARION_URL: ${{ secrets.POLARION_URL }} + POLARION_USERNAME: ${{ secrets.POLARION_USERNAME }} + POLARION_PASSWORD: ${{ secrets.POLARION_PASSWORD }} + run: | + curl -k -u ${{ secrets.POLARION_USERNAME }}:${{ secrets.POLARION_PASSWORD }} \ + -X POST -F file=@test_case.xml \ + ${{ secrets.POLARION_URL }}/polarion/import/testcase