Skip to content

ci: fuse the build & test to one #3

ci: fuse the build & test to one

ci: fuse the build & test to one #3

Workflow file for this run

name: Compile and test C++ package
on:
push:
branches: [ develop/main, develop/3.10 ]
pull_request:
branches: [ develop/main, develop/3.10 ]
jobs:
build-test:
name: Build and Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-20.04", "macOS-11", "windows-latest" ]
python-version: ["3.10"]
dot-net-version: [ "7.0.100" ]
env:
BUILD_TYPE: Release
PYTHONIOENCODING: utf-8
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install CLR requirements
if: runner.os == 'Linux'
run: |
sudo apt-get -y update
sudo apt-get install -y cmake llvm-9 clang-9 autoconf automake \
libtool build-essential python curl git lldb-6.0 liblldb-6.0-dev \
libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev \
libssl-dev libnuma-dev libkrb5-dev zlib1g-dev
- uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dot-net-version }}
- name: Add msbuild to PATH
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v1.3.1
- name: Create Build Environment
run: cmake -E make_directory "${{runner.workspace}}/build"
- name: Configure & Build CMake
working-directory: ${{runner.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TESTS=ON
cmake --build . --config $BUILD_TYPE
- name: Build & Install Python Package [Unix]
if: runner.os != 'Windows'
run: |
python -m pip install --upgrade pip
pip install .
- name: Build & Install Python Package [Windows]
# todo: not sure why this is different then Unix
if: runner.os == 'Windows'
run: |
python -m pip install -U scikit-build
python setup.py build
python setup.py install
- name: Run C++ unit tests [Unix]
if: runner.os != 'Windows'
working-directory: ${{runner.workspace}}/build
run: ./unit_tests --out test.log -s --use-colour yes
- name: Run C++ unit tests [Windows]
if: runner.os == 'Windows'
working-directory: ${{runner.workspace}}/build/Release
run: |
cp c:\Users\runneradmin\AppData\Local\Microsoft\dotnet\shared\Microsoft.NETCore.App\7.0.0\clrjit.dll .
.\unit_tests.exe
- name: Setup Python tests
run: pip install -r Tests/requirements_test.txt
- name: Run pytest tests (level 0)
run: python -X dev -m pytest Tests/ -v --opt-level 0
- name: Run pytest tests (level 1)
run: python -X dev -m pytest Tests/ -v --opt-level 1
- name: Run pytest tests (level 2)
run: python -X dev -m pytest Tests/ -v --opt-level 2
- name: Run pytest tests (level 0) + external
run: python -X dev -m pytest Tests/ -v --opt-level 0 --external
- name: Run pytest tests (level 1) + external
run: python -X dev -m pytest Tests/ -v --opt-level 1 --external
- name: Test module entry point
run: |
python -m pyjion -m calendar
python -m pyjion -m calendar 1999
python -m pyjion Tests/hello.py
pyjion -m calendar 1999
pyjion Tests/hello.py
- name: Run smoke tests
run: |
python -X dev -q Tests/run_cpython_tests.py -f Tests/python_smoke_tests.txt -o 0
python -X dev -q Tests/run_cpython_tests.py -f Tests/python_smoke_tests.txt -o 1
python -X dev -q Tests/run_cpython_tests.py -f Tests/python_smoke_tests.txt -o 1 --pgc
python -X dev -q Tests/run_cpython_tests.py -f Tests/python_smoke_tests.txt -o 2
continue-on-error: true
- name: Test IPython REPL
run: |
pip install ipython
python -X dev -m IPython -c="import pyjion;pyjion.enable();a=1+1;a"
- name: Install scikit-build for wheel
run: |
python -m pip install -U scikit-build
# todo: this could be also fused
- name: Run full test suite
if: runner.os == 'Linux'
run: python -X dev -q Tests/run_cpython_tests.py -f Tests/python_tests.txt -o 1
continue-on-error: true
timeout-minutes: 30
- name: Run full test suite
if: runner.os == 'MacOS'
run: python -X dev -q Tests/run_cpython_tests.py -f Tests/python_tests_macos11.txt -o 1
continue-on-error: true
timeout-minutes: 30
- name: Run full test suite
if: runner.os == 'Windows'
run: python -X dev -q Tests/run_cpython_tests.py -f Tests/python_tests_win.txt -o 1
continue-on-error: true
timeout-minutes: 30