-
Notifications
You must be signed in to change notification settings - Fork 3.8k
95 lines (91 loc) · 3.01 KB
/
static_analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# contains non-functional tests, like checks on docs
# and code style
name: Static Analysis
on:
push:
branches:
- master
- ci/iwyu
pull_request:
branches:
- master
# automatically cancel in-progress builds if another commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
COMPILER: 'gcc'
MAKEFLAGS: '-j4'
OS_NAME: 'linux'
PYTHON_VERSION: '3.12'
jobs:
test:
name: ${{ matrix.task }}
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- task: lint
# - task: check-docs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 5
submodules: true
- name: Setup and run tests
shell: bash
run: |
export TASK="${{ matrix.task }}"
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export CONDA=${HOME}/miniforge
export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH}
$GITHUB_WORKSPACE/.ci/setup.sh || exit 1
$GITHUB_WORKSPACE/.ci/test.sh || exit 1
# r-check-docs:
# name: r-package-check-docs
# timeout-minutes: 60
# runs-on: ubuntu-latest
# container: rocker/verse
# steps:
# - name: Trust git cloning LightGBM
# run: |
# git config --global --add safe.directory "${GITHUB_WORKSPACE}"
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# fetch-depth: 5
# submodules: true
# - name: Install packages
# shell: bash
# run: |
# Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
# sh build-cran-package.sh || exit 1
# R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1
# - name: Test documentation
# shell: bash --noprofile --norc {0}
# run: |
# Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1
# num_doc_files_changed=$(
# git diff --name-only | grep --count -E "\.Rd|NAMESPACE"
# )
# if [[ ${num_doc_files_changed} -gt 0 ]]; then
# echo "Some R documentation files have changed. Please re-generate them and commit those changes."
# echo ""
# echo " sh build-cran-package.sh"
# echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz"
# echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\""
# echo ""
# exit 1
# fi
# all-static-analysis-jobs-successful:
# if: always()
# runs-on: ubuntu-latest
# needs: [test, r-check-docs]
# steps:
# - name: Note that all tests succeeded
# uses: re-actors/[email protected]
# with:
# jobs: ${{ toJSON(needs) }}