From f5e218bf840a6d95ceaf8cd5724ee757983d7306 Mon Sep 17 00:00:00 2001 From: Simon D Fink Date: Sat, 13 Apr 2024 13:16:04 +0200 Subject: [PATCH] import first version of workflow --- .github/workflows/test.yml | 129 +++++++++++++++++++++++++++++++++++++ README.md | 3 + 2 files changed, 132 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 README.md diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..87978dd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,129 @@ +name: Test cppyy packages + +on: + workflow_dispatch: + env: + description: 'Additional variables to be appended to environment by writing them to $GITHUB_ENV.' + required: true + default: '' + type: string + ver-cppyy: + description: 'Version of cppyy to use.' + required: true + default: 'nightly' + type: string + ver-cppyy-cling: + description: 'Version of cppyy-cling to use.' + required: true + default: 'nightly' + type: string + ver-cppyy-backend: + description: 'Version of cppyy-backend to use.' + required: true + default: 'nightly' + type: string + ver-CPyCppyy: + description: 'Version of CPyCppyy to use.' + required: true + default: 'nightly' + type: string + ver-python + description: 'Version of Python to use.' + required: true + default: '3.x' + type: string + +defaults: + run: + shell: bash + +jobs: + test: + name: Test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-14, macos-13, windows-latest ] + + steps: + + - name: Set environment variables + # see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable + run: echo "${{ inputs.env }}" >> "$GITHUB_ENV" + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.ver-python }} + + - name: Get python info + run: python3 -VV + + + - name: Install cppyy-cling nightly + run: | + # curl -sSf $(curl -sSf https://api.github.com/repos/wlav/cppyy-backend/actions/artifacts?per_page=1 | jq -r ".artifacts[0].archive_download_url") -o cppyy-backend.zip + curl -sSfL https://nightly.link/wlav/cppyy-backend/workflows/cling-wheels/master/artifact.zip -o cppyy-cling.zip + unzip cppyy-cling.zip -d cppyy-cling + + pip3 install cppyy-cling --no-index --no-deps --find-links ./cppyy-cling + if: ${{ inputs.ver-cppyy-cling == 'nightly' }} + + - name: Install cppyy-cling from pip + run: | + pip3 install cppyy-cling${{ inputs.ver-cppyy-cling }} --no-deps + if: ${{ inputs.ver-cppyy-cling != 'nightly' }} + + + - name: Install cppyy-backend nightly + run: | + pip3 install git+https://github.com/wlav/cppyy-backend.git#subdirectory=clingwrapper --no-deps + if: ${{ inputs.ver-cppyy-backend == 'nightly' }} + + - name: Install cppyy-backend from pip + run: | + pip3 install cppyy-backend${{ inputs.ver-cppyy-backend }} --no-deps + if: ${{ inputs.ver-cppyy-backend != 'nightly' }} + + + - name: Install CPyCppyy nightly + run: | + pip3 install git+https://github.com/wlav/CPyCppyy.git --no-deps + if: ${{ inputs.ver-CPyCppyy == 'nightly' }} + + - name: Install CPyCppyy from pip + run: | + pip3 install CPyCppyy${{ inputs.ver-CPyCppyy }} --no-deps + if: ${{ inputs.ver-CPyCppyy != 'nightly' }} + + + - name: Install cppyy nightly + run: | + pip3 install git+https://github.com/wlav/cppyy.git --no-deps + if: ${{ inputs.ver-cppyy == 'nightly' }} + + - name: Install cppyy from pip + run: | + pip3 install cppyy${{ inputs.ver-cppyy }} --no-deps + if: ${{ inputs.ver-cppyy != 'nightly' }} + + + - name: Get installed packages info + run: pip3 freeze + + - name: Check C++ version used by cppyy + run: python3 -c "import cppyy; cppyy.cppexec('std::cout << __GLIBCXX__ << std::endl;')" + + + - name: Get cpyyy test suite + uses: actions/checkout@v4 + with: + repository: 'wlav/cppyy' + sparse-checkout: 'test/' + + - name: Install pytest + run: pip3 install pytest + + - name: Run pytest suite + run: pytest + working-directory: ./test diff --git a/README.md b/README.md new file mode 100644 index 0000000..d0aae66 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# GitHub Actions CI for cppyy + +This repo provides a GitHub Actions CI workflow that tests cppyy on different systems. \ No newline at end of file