diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..7f31946 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,57 @@ +name: Linux +on: + workflow_dispatch: + pull_request: + push: + branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash -e -l {0} +jobs: + build: + runs-on: ubuntu-24.04 + name: ${{ matrix.sys.compiler }} ${{ matrix.sys.version }} + strategy: + fail-fast: false + matrix: + sys: + - {compiler: gcc, version: '11',} + - {compiler: gcc, version: '12'} + - {compiler: gcc, version: '13'} + - {compiler: gcc, version: '14'} + - {compiler: gcc, version: '11', novendor: 1} + - {compiler: gcc, version: '12', novendor: 1} + - {compiler: gcc, version: '13', novendor: 1} + - {compiler: gcc, version: '14', novendor: 1} + #- {compiler: clang, version: '19'} + - {compiler: clang, version: '20'} + + steps: + + - name: Install GCC + if: matrix.sys.compiler == 'gcc' + uses: egor-tensin/setup-gcc@v1 + with: + version: ${{matrix.sys.version}} + platform: x64 + + - name: Install LLVM and Clang + if: matrix.sys.compiler == 'clang' + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh ${{matrix.sys.version}} + sudo apt-get install -y clang-tools-${{matrix.sys.version}} + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{matrix.sys.version}} 200 + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{matrix.sys.version}} 200 + sudo update-alternatives --install /usr/bin/clang-scan-deps clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.sys.version}} 200 + sudo update-alternatives --set clang /usr/bin/clang-${{matrix.sys.version}} + sudo update-alternatives --set clang++ /usr/bin/clang++-${{matrix.sys.version}} + sudo update-alternatives --set clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.sys.version}} + + - name: Build and run tests + uses: ./.github/workflows/unix_impl.yml + diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml new file mode 100644 index 0000000..f066647 --- /dev/null +++ b/.github/workflows/osx.yml @@ -0,0 +1,28 @@ +name: OSX +on: + workflow_dispatch: + pull_request: + push: + branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash -e -l {0} +jobs: + build: + runs-on: macos-${{ matrix.os }} + name: macos-${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - 14 + - 15 + + steps: + + - name: Build and run tests + uses: ./.github/workflows/unix_impl.yml + diff --git a/.github/workflows/unix_impl.yml b/.github/workflows/unix_impl.yml new file mode 100644 index 0000000..d0ab680 --- /dev/null +++ b/.github/workflows/unix_impl.yml @@ -0,0 +1,49 @@ +name: "Common steps for Linux and OSX" +runs: + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set conda environment + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: environment-dev.yml + cache-environment: true + + - name: Install NOVENDOR dependencies + if: env.NOVENDOR == '1' + run: | + if [[ $USE_DEV_XTENSOR_R == 1 ]]; then + micromamba install xtensor==0.24.4 xsimd=10.0.0 cmake -c conda-forge; + git clone https://github.com/xtensor-stack/xtensor-r.git; + cd xtensor-r; mkdir build; cd build; + cmake -D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..; + make install; + cd ../..; + else + micromamba install xtensor-r==0.14.0 -c conda-forge; + fi + + - name: Build Xtensor.R package + run: | + R CMD build ${{ github.workspace }}; + + - name: Check R package + run: | + if [[ $NOVENDOR == 1 ]]; then + echo "Running R CMD check with --novendor argument"; + echo "R CMD check --install-args=\"--configure-args='--novendor'\" ./xtensor_*.tar.gz" + R CMD check --install-args="--configure-args='--novendor'" ./xtensor_*.tar.gz || ( + cat xtensor.Rcheck/00install.out && + cat xtensor.Rcheck/00check.log && + cat xtensor.Rcheck/Rdlatex.log + ); + else + echo "Running R CMD check with --as-cran argument."; + echo "R CMD check --as-cran ./xtensor_*.tar.gz" + R CMD check --as-cran ./xtensor_*.tar.gz || ( + cat xtensor.Rcheck/00install.out && + cat xtensor.Rcheck/00check.log && + cat xtensor.Rcheck/Rdlatex.log + ); + fi diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 38a471d..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,9 +0,0 @@ -trigger: - - master - -jobs: - - template: ./.azure-pipelines/azure-pipelines-linux-clang.yml - - template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml - -