* First attempt at GHA CI instead of Azure Pipelines. * Could I have the matrix config wrong? * Oh, oops, I was just looking in the wrong place for the GHA log. * Disable Azure Pipelines Linux job. * Fix some additional small syntax errors. * Minor updates. * Try to figure out what is happening with this test! * Ha, actually remember the argument. * Try to parse the CTest results. * Don't build CLI programs for the debug-only mlpack_test build. * Try to figure out why we don't have the CTest output file. * Seems like maybe the test just needs more iterations. * Fix directory for CTest output. * Try running mlpack_test manually to see if we get better test output. * Remove version numbers and other non-XML from XML output test file. * Try to fix debug build. * Filtering regex. * Try to fail the build when the tests fail. * Minor fixes and cleanups to run Python binding tests. * Print test failure information in the actual build step. * Update Julia testing strategy. * Try to also get outputs from other test bindings. * Fix Julia and Go testing blocks. * Avoid random collisions that cause test failures. * Try moving splitting into the trial loop. * Try a different test reporter action. * Install pytest for Python tests. * Fix working directory for Julia test. * Add test case that will fail to see what it looks like. * Back to the old action, the new one I tried didn't do what I needed. * Try a better way to print the test output. * I still don't know how to mark the job failed yet. * Maybe this stdout character works better. * Try a forked test-summary action. * Try to use distribution version of the modified action. * Try to see if ccache is doing anything. * Always run ccache stats step. * Turn off PCH for ccache. * Let's just see what it looks like with more error output. * Clean up ccache configuration. * Remove fake test because it seems like now I have the output working right. * Try to reduce file size by not printing debug output into it. * Try and refactor binding environment seutp into a composite local action. * Try to fix some syntactical errors. * Refactor test running into a separate composite action. * Start trying to make the R build part of the main CI build. * Oops, the include directory was in the wrong place. * Try actually running R tests in the workflow too. * Try to fix a few action issues. * Try to work around libicu issue. * Remove unnecessary option. * Try to run OS X builds too. * Try to fix matrix configuration. * Revert "Try to fix matrix configuration." This reverts commit 22a08d6dcd0d39de0a27f2df16e885bd68e18fda. * Oops, maybe it was just an extra comma. * Fix naming, and maybe we have to remove stringi first. * Try to set Julia location correctly. * Some fixes to the pipelines. * Oops, I need root for that. * Some additional fixes for jobs. * Hopefully fix a few more builds. * What, how did that get there? * Don't use non-portable -i option with sed. * Run R tests properly to get junit output. * Oops, I have to redirect the output. * Where is the output file? * Try to fix macOS Python location. * Oops, ROOTDIR is just not set. * Try to store the name of the R package correctly. * Oops, we need to specify pip. * Try to get the right directory for the R package. * Try to fix another round of issues. I'm getting closer, at least. * Okay, fine, let's do it the brutalistic way. * What is actually happening with the Go binding tests? * Try a different strategy for printing. * Make some updates to prepare for Windows builds. * What's the output of go test? * Remove -Wall as per golang/go#6883. * Try to fix duplicate library warning. * Maybe I just specified the variable in an invalid way that didn't stick? * This should fix the Go build. * How did that cd go missing? * Try to remove DEBUG output from the debug tests. * Try to be more specific about the ccache key. * Oops, incorrect variable name. * Try to speed up the testing step. * Try to run the Windows build through GHA. * Try to install locally to deps/. * Try to install and set up Windows dependencies correctly. * Try to debug Windows build. * Use bash for CMake configuration. * Some additional path fixes. * A couple fixes, but I don't have the Armadillo path right. * Fix curl command. * Maybe this is closer to the right path... * Okay, look one directory deeper... * Temporarily print STB compilation failure. * Try to use absolute path for STB inclusion test. * Oops, fix syntax. * Try using REALPATH instead. * Try just skipping the check... * Try specifying BLAS and LAPACK locations directly. * Try to figure out what is going on. * Are we even using the correct FindArmadillo script? * Try specifying the libraries manually. * Try disabling the wrapper library. * What version of CMake is this? * Print the configuration. * What if we specify these library locations? * Double-check: this should fail. * Okay, that actually surprisingly did not fail. * Fix style issues. * Compress into only one GHA file so all the jobs show up in the same place. * Try to use absolute path to OpenBLAS. * Try to fix path mangling on Windows. * Fix STB path and no PS please. * Try to fix output on Windows tests. * Call test from the right place. * Remove some unnecessary output. * Try just running the test. * What is going on, why doesn't the test run? * Try just running the test with PowerShell. * Maybe I have the filename wrong? * PowerShell makes me angry... * Right, .exe is the suffix... * I love PowerShell! * Okay, forget PowerShell. * Can we even run the test? * Is it a DLL search path issue? * Okay, I think this might work for Windows. * Fix porting of new r2u/p3m workflow (hopefully). * Fix possibly incorrect variable name. * Reduce the number of macOS jobs. * Fix name of job. * Remove potentially unnecessary step. * Document CI changes and reorganize jobs for better viewing. * Remove invalid link. (Awesome that the link check build picked this up.)
158 lines
6.4 KiB
Markdown
158 lines
6.4 KiB
Markdown
# mlpack continuous integration (CI) systems
|
|
|
|
Every pull request submitted to mlpack goes through a number of automated checks
|
|
to make sure that all unit tests pass, all code matches the desired style guide,
|
|
documentation does not contain any broken links, and so on and so forth.
|
|
|
|
In general, all CI checks need to pass for PRs to be merged, but like any
|
|
complex project, there are occasionally spurious failures or other unrelated
|
|
problems.
|
|
|
|
* [Basic compilation and test jobs](#basic-compilation-and-test-jobs)
|
|
* [Documentation build and test](#documentation-build-and-test)
|
|
* [Style checks](#style-checks)
|
|
* [Cross-compilation checks](#cross-compilation-checks)
|
|
* [Static code analysis checks](#static-code-analysis-checks)
|
|
|
|
Also you can see the [list of CI infrastructure](#list-of-ci-infrastructure).
|
|
|
|
## Basic compilation and test jobs
|
|
|
|
Basic compilation and testing is done on Github Actions.
|
|
We use Github Actions primarily because of the large number of resources that
|
|
an mlpack build takes; our own [internal resources](#list-of-ci-infrastructure)
|
|
are thus preserved for more specific usage.
|
|
|
|
Link: [***mlpack on Github Actions***](https://github.com/mlpack/mlpack/actions)
|
|
|
|
* Builds and tests mlpack for Linux, macOS, and Windows.
|
|
|
|
* Also builds and tests all bindings on Linux, and Python bindings on macOS.
|
|
|
|
* Builds the R tarball that can be submitted to CRAN and publishes it as an
|
|
artifact.
|
|
|
|
* Configurations for these jobs can be found in the mlpack repository under the
|
|
`.github/` directory.
|
|
- The main file for the build pipeline is `.github/workflows/ci.yml`.
|
|
|
|
* *These jobs are most of what's shown in the jobs in a PR.*
|
|
|
|
***If your build is failing on Github Actions:***
|
|
|
|
* Take a look at the build summary and build logs to identify the issue.
|
|
|
|
* If the failure is during `mlpack_test`, look through the test output to find
|
|
where the actual failed test is.
|
|
- If the failed test is related to your code, you probably have a bug to fix.
|
|
:)
|
|
- If the failed test does not seem related at all, it could be a spurious
|
|
error in another test.
|
|
- You can run the test locally with `bin/mlpack_test NameOfTest`.
|
|
- If the test seems like a random failure, try different random seeds:
|
|
`bin/mlpack_test --rng-seed=X NameOfTest`.
|
|
|
|
## Binding tests
|
|
|
|
Inside of `.github/workflows/ci.yml`, the bindings are configured and built
|
|
(depending on the parameters of the matrix build) using a local Github action.
|
|
Similarly, the binding tests are also run using a local Github action.
|
|
|
|
* `.github/actions/binding_setup/main.yml` defines the steps required to set up
|
|
the environment for building each type of binding. Sometimes the steps are
|
|
specific to an OS (e.g. Linux/macOS/Windows).
|
|
|
|
* `.github/actions/binding_run_tests/main.yml` defines the steps to run tests
|
|
for each binding type. Note that because we want output as junit XML so we
|
|
can parse it, sometimes we have to do strange things for some languages, and
|
|
we can't use CTest directly.
|
|
|
|
## Documentation build and test
|
|
|
|
The 'documentation build and test' job builds and tests *all* documentation,
|
|
checking:
|
|
|
|
* that all Markdown pages build and render properly;
|
|
* that all HTML is valid;
|
|
* that all links referenced in the documentation are valid;
|
|
* that all code examples compile and run.
|
|
|
|
All of the scripts to perform these builds are located in the `scripts/`
|
|
directory, so that they can be run locally.
|
|
|
|
* `./scripts/build-docs.sh`
|
|
- Builds all documentation in `doc/` with the output directory `doc/html/`.
|
|
- If you browse to `doc/html/index.html` you can browse locally-built
|
|
documentation.
|
|
- Checks all HTML links and anchors.
|
|
|
|
* `./scripts/test-docs.sh doc/`
|
|
* `./scripts/test-docs.sh doc/path/to/file.md`
|
|
- Extracts code blocks from documentation and compiles and runs them.
|
|
- Can be run on either all the documentation (with `doc/` or directory
|
|
argument), or a single file.
|
|
- May require `CXX`, `CXXFLAGS`, and `LDFLAGS` environment variables to be
|
|
set. See the script itself for more details.
|
|
- If run on an individual file, the output of each compiled code snippet will
|
|
be printed.
|
|
|
|
When writing new documentation, be sure to test it locally---going back and
|
|
forth with the
|
|
[job on Jenkins](http://ci.mlpack.org/job/pull-request%20documentation%20build%20and%20test/)
|
|
can be very tedious.
|
|
|
|
## Style checks
|
|
|
|
The [style checker job](http://ci.mlpack.org/job/pull-requests%20mlpack%20style%20checks/) runs on Jenkins.
|
|
|
|
* The [`lint.sh` script](https://github.com/mlpack/jenkins-conf/blob/master/linter/lint.sh) to check for C++ style issues.
|
|
|
|
* If your job failed this check, look at the "Test Result" tab in the Jenkins
|
|
job. Style issues for each file will be displayed in an expandable block.
|
|
|
|
* See also the
|
|
[style guidelines for mlpack](https://github.com/mlpack/mlpack/wiki/DesignGuidelines).
|
|
|
|
## Cross-compilation checks
|
|
|
|
The [cross-compilation checks](http://ci.mlpack.org/job/CrossCompile-mlpack-for-embedded-aarch64/)
|
|
run on Jenkins.
|
|
|
|
* The job builds mlpack in a
|
|
[cross-compilation environment](../embedded/supported_boards.md).
|
|
|
|
* Any failures seen here *that are not seen in other jobs* will probably be
|
|
failures specific to the cross-compilation environment.
|
|
|
|
## Static code analysis checks
|
|
|
|
The [static code analysis checks](http://ci.mlpack.org/job/pull-requests-mlpack-static-code-analysis/)
|
|
use a few C++ code analysis tools to try and report issues with the codebase.
|
|
|
|
Currently, most of the output by this job is not actionable---there are too many
|
|
false positives or spurious issues---and therefore should be used only as
|
|
informational output.
|
|
|
|
Configuration can be found in the
|
|
[`jenkins-conf` repository](https://github.com/mlpack/jenkins-conf).
|
|
|
|
## List of CI infrastructure
|
|
|
|
Many physical systems are involved with testing mlpack and are hooked up to
|
|
Jenkins.
|
|
|
|
Link: [***Jenkins (`ci.mlpack.org`)***](http://ci.mlpack.org)
|
|
|
|
* The 'specialized' build system.
|
|
|
|
* Various Jenkins configuration related resources are found in the
|
|
[`jenkins-conf` repository](https://github.com/mlpack/jenkins-conf/).
|
|
|
|
* The list of workers (individual systems) can be found
|
|
[here](http://ci.mlpack.org/computer/).
|
|
|
|
* Adding or modifying jobs requires privileges; you can either ask an mlpack
|
|
maintainer to make changes, or if you are on the Contributors team but still
|
|
don't have access, ask somewhere and someone will give you access. (Probably
|
|
`#mlpack:matrix.org` is the best bet!)
|