Repository navigation
Test — Python #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test — Python | |
| # Exercises the whole regression pipeline for Python: | |
| # 1. Build srcml from source on ubuntu-24.04-arm via the ci-ubuntu cmake workflow preset. | |
| # 2. Collect the .deb produced by CPack. | |
| # 3. Run the reusable regression-test.yml against the current Python baselines. | |
| # | |
| # Requires: a baseline release must already be published for each project | |
| # (run baseline-python.yml first). | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| srcml_repo: | |
| description: "srcML repository to build from (owner/repo — supports forks)" | |
| required: false | |
| default: "srcML/srcML" | |
| srcml_ref: | |
| description: "srcML git ref to build (tag, branch, or SHA)" | |
| required: false | |
| default: "develop" | |
| fail_on_regression: | |
| description: "Fail the workflow if the regression test reports failures" | |
| required: false | |
| type: boolean | |
| default: true | |
| permissions: | |
| contents: read | |
| actions: read | |
| concurrency: | |
| group: test-python-${{ github.ref }}-${{ inputs.srcml_ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-srcml: | |
| runs-on: ubuntu-24.04-arm | |
| timeout-minutes: 60 | |
| outputs: | |
| artifact_name: ${{ steps.upload.outputs.artifact-name }} | |
| steps: | |
| - name: Checkout srcML source | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ inputs.srcml_repo }} | |
| ref: ${{ inputs.srcml_ref }} | |
| path: srcML | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| antlr libantlr-dev libantlr-java \ | |
| libarchive-dev libcurl4-openssl-dev \ | |
| libxcb1-dev \ | |
| libxml2-dev libxml2-utils libxslt1-dev \ | |
| cmake ninja-build g++ dpkg-dev | |
| # Not `cmake --workflow --preset ci-ubuntu`: that workflow preset continues | |
| # past the package step into install_package, whose apt-get install has no | |
| # sudo (it is meant to run as root inside srcML's build containers) and so | |
| # exits 100 on a GitHub runner. Only the .deb is needed here; it gets | |
| # installed later, with sudo, by regression-test.yml. | |
| - name: Configure, build, and package srcML | |
| working-directory: srcML | |
| run: | | |
| set -euxo pipefail | |
| cmake --preset ci-ubuntu | |
| cmake --build --preset ci-ubuntu | |
| cpack --preset ci-ubuntu | |
| - name: Locate .deb artifacts | |
| id: locate | |
| run: | | |
| set -euo pipefail | |
| # ci-ubuntu uses ci-sibling-build -> build dir is srcML-build/ alongside srcML/ | |
| BUILD_DIR="srcML-build" | |
| DIST_DIR="${BUILD_DIR}/dist" | |
| if [ ! -d "$DIST_DIR" ]; then | |
| echo "::error::CPack output directory not found: $DIST_DIR" | |
| ls -la "$BUILD_DIR" || true | |
| exit 1 | |
| fi | |
| ls -la "$DIST_DIR" | |
| mkdir -p installer | |
| # srcml_*.deb is required; srcml-dev_*.deb is optional | |
| if ! compgen -G "${DIST_DIR}/srcml_*.deb" > /dev/null; then | |
| echo "::error::no srcml_*.deb produced by CPack" | |
| exit 1 | |
| fi | |
| cp "${DIST_DIR}"/srcml_*.deb installer/ | |
| cp "${DIST_DIR}"/srcml-dev_*.deb installer/ 2>/dev/null || true | |
| ls -la installer/ | |
| echo "deb_count=$(ls installer/*.deb | wc -l)" >> "$GITHUB_OUTPUT" | |
| - name: Upload installer artifact | |
| id: upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: srcml-installer-from-source | |
| path: installer/ | |
| if-no-files-found: error | |
| regression: | |
| needs: build-srcml | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - {language: python, project: django} | |
| uses: ./.github/workflows/regression-test.yml | |
| with: | |
| srcml-installer-artifact-name: srcml-installer-from-source | |
| language: ${{ matrix.target.language }} | |
| project: ${{ matrix.target.project }} | |
| fail-on-regression: ${{ inputs.fail_on_regression }} | |
| artifact-name: full-pipeline-${{ matrix.target.language }}-${{ matrix.target.project }} |