Skip to content

CI

CI #649

Workflow file for this run

name: CI
on:
push:
pull_request:
schedule: [cron: "20 5 * * *"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
link: [static, dynamic]
exclude:
- os: macos-13
link: static
- os: macos-latest
link: static
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Make build dir
run: mkdir submodules/LightGBM/build
- name: Build LightGBM (windows - static)
if: matrix.os == 'windows-latest' && matrix.link == 'static'
run: |
echo "LIGHTGBM_LIB_DIR=${{ github.workspace }}/submodules/LightGBM/Release" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
cd submodules/LightGBM/build
cmake -A x64 -DBUILD_STATIC_LIB=ON ..
cmake --build . --target ALL_BUILD --config Release
- name: Build LightGBM (windows - dynamic)
if: matrix.os == 'windows-latest' && matrix.link == 'dynamic'
run: |
echo "LIGHTGBM_LIB_DIR=${{ github.workspace }}/submodules/LightGBM/Release" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "${{ github.workspace }}/submodules/LightGBM/Release" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
cd submodules/LightGBM/build
cmake -A x64 ..
cmake --build . --target ALL_BUILD --config Release
- name: Build LightGBM (ubuntu - static)
if: matrix.os == 'ubuntu-latest' && matrix.link == 'static'
run: |
echo "LIGHTGBM_LIB_DIR=${{ github.workspace }}/submodules/LightGBM" >> $GITHUB_ENV
cd submodules/LightGBM/build
cmake -DBUILD_STATIC_LIB=ON ..
make -j4
- name: Build LightGBM (ubuntu - dynamic)
if: matrix.os == 'ubuntu-latest' && matrix.link == 'dynamic'
run: |
echo "LIGHTGBM_LIB_DIR=${{ github.workspace }}/submodules/LightGBM" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ github.workspace }}/submodules/LightGBM" >> $GITHUB_ENV
cd submodules/LightGBM/build
cmake ..
make -j4
- name: Install LightGBM (macos-13 - dynamic)
if: matrix.os == 'macos-13' && matrix.link == 'dynamic'
run: |
brew install lightgbm
- name: Install LightGBM (macos - dynamic)
if: matrix.os == 'macos-latest' && matrix.link == 'dynamic'
run: |
brew install lightgbm
echo "LIGHTGBM_LIB_DIR=/opt/homebrew/Cellar/lightgbm/4.5.0/lib/" >> $GITHUB_ENV
- name: Rustup update stable
run: rustup update stable
- name: Show cargo version
run: cargo --version -v
- name: Build
run: cargo build --verbose
- name: Build tests
run: cargo test --verbose --no-run
- name: Run tests
run: cargo test --verbose
# - name: Run compile fail tests
# run: cargo test --test compile_fail --verbose -- --ignored
- name: Clippy
run: cargo clippy --all-features --tests --lib -- -W clippy::all
env:
RUSTFLAGS: -D warnings
# - name: Rustup toolchain install nightly
# run: rustup toolchain install nightly
# - name: Set minimal versions
# run: cargo +nightly update -Z minimal-versions
# - name: Build tests (minimal versions)
# run: cargo +stable test --verbose --no-run
# - name: Run tests (minimal versions)
# run: cargo +stable test --verbose