c/Makefile (asan): Run with DEBUG=0 by default. #837
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: R | |
| on: | |
| push: | |
| branches: [main] | |
| tags-ignore: ["**"] | |
| paths: | |
| - ".github/workflows/rchk.yml" | |
| - ".github/workflows/R.yml" | |
| - "r/**" | |
| - "!r/README.md" | |
| - 'c/Make*' | |
| - 'c/*.mk' | |
| - 'c/**/*.[ch]p?p?' | |
| pull_request: | |
| branches-ignore: [gh-pages] | |
| paths: | |
| - ".github/workflows/rchk.yml" | |
| - ".github/workflows/R.yml" | |
| - "r/**" | |
| - "!r/README.md" | |
| - 'c/Make*' | |
| - 'c/*.mk' | |
| - 'c/**/*.[ch]p?p?' | |
| # Manual run | |
| workflow_dispatch: | |
| env: | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
| _R_CHECK_FORCE_SUGGESTS_: false | |
| _R_CHECK_CRAN_INCOMING_REMOTE_: false | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| R-CMD-check: | |
| if: "! contains(github.event.head_commit.message, '[skip ci]')" | |
| runs-on: ${{ matrix.os }} | |
| name: Check ${{ matrix.os }} (${{ matrix.r }}) | |
| strategy: | |
| # When set to true, GitHub cancels all in-progress jobs if any matrix job fails. | |
| fail-fast: true | |
| matrix: | |
| # macos-15-intel is an intel runner, macos-14 is apple silicon | |
| os: [ ubuntu-22.04, windows-latest, macos-15-intel, macos-14 ] | |
| r: [ release ] | |
| include: | |
| - { os: windows-latest, r: '4.1' } | |
| # Use latest ubuntu to make it easier to install dependencies | |
| - { os: ubuntu-24.04, r: 'devel', http-user-agent: 'release' } | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| MAKEFLAGS: "-j 2" | |
| steps: | |
| - name: Disable autocrlf | |
| if: runner.os == 'Windows' | |
| run: git config --global core.autocrlf false | |
| - uses: actions/checkout@v6 | |
| - name: Fix permissions | |
| if: runner.os == 'Windows' | |
| run: chmod +x r/cleanup | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.r }} | |
| http-user-agent: ${{ matrix.http-user-agent }} | |
| use-public-rspm: true | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| install-pandoc: true | |
| extra-packages: any::purrr@1.0.4, any::remotes, any::rcmdcheck, any::spelling | |
| needs: check | |
| working-directory: r | |
| - name: Check (NOT CRAN) | |
| env: | |
| NOT_CRAN: true | |
| uses: r-lib/actions/check-r-package@v2 | |
| with: | |
| args: 'c("--no-manual", "--run-donttest", "--run-dontrun", "--timings")' | |
| working-directory: r | |
| - name: Check (as CRAN) | |
| if: matrix.os != 'ubuntu-24.04' | |
| env: | |
| NOT_CRAN: false | |
| uses: r-lib/actions/check-r-package@v2 | |
| with: | |
| args: 'c("--no-manual", "--as-cran")' | |
| working-directory: r | |
| - name: Stricter CFLAGS | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: | | |
| mkdir -p ~/.R | |
| echo 'CFLAGS=-g -O2 -Wall -Wstrict-prototypes -pedantic -fstack-protector-strong -DUSE_TYPE_CHECKING_STRICT -D_FORTIFY_SOURCE=3 -DSTRICT_R_HEADERS=1 -Werror' > ~/.R/Makevars | |
| shell: bash | |
| working-directory: r | |
| - name: Check (as CRAN) with stricter CFLAGS and GCC 14 | |
| if: matrix.os == 'ubuntu-24.04' | |
| env: | |
| NOT_CRAN: false | |
| CC: gcc-14 | |
| uses: r-lib/actions/check-r-package@v2 | |
| with: | |
| args: 'c("--no-manual", "--as-cran")' | |
| working-directory: r | |
| - name: Show testthat output | |
| if: failure() | |
| run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true | |
| shell: bash | |
| working-directory: r | |
| - name: Install package | |
| run: | | |
| remotes::install_local(".", force = TRUE, upgrade = "never", build_manual = TRUE, build_vignettes = TRUE) | |
| shell: Rscript {0} | |
| working-directory: r | |
| coverage: | |
| needs: R-CMD-check | |
| name: Coverage ${{ matrix.os }} (${{ matrix.r }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| r: [release] | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.r }} | |
| use-public-rspm: true | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| install-pandoc: true | |
| extra-packages: any::covr any::xml2 any::rex | |
| needs: coverage | |
| working-directory: r | |
| - name: Test coverage | |
| env: | |
| NOT_CRAN: true | |
| run: | | |
| exclude_pattern = rex::rex(or(group(or("#", "//"), any_spaces, "nocov"), | |
| group(or("ASSUME", "unreachable", "assert"), maybe(" "), "("), | |
| group(or("DEBUG1", "DEBUG2", "DEBUG3"), maybe("_PRINT")), | |
| group(or("GCOV", "GCOVR", "LCOV"), "_EXCL_LINE"))) | |
| options(covr.gcov_additional_paths="c", | |
| covr.filter_non_package=FALSE, | |
| covr.exclude_pattern=exclude_pattern) | |
| coverage <- withr::with_makevars(c(MOOCORE_DEBUG="1", LTO_OPT="-fno-lto"), | |
| covr::package_coverage(type="all", quiet=FALSE, clean=FALSE, | |
| commentDonttest = FALSE, commentDontrun = FALSE, flags="R", | |
| relative_path=normalizePath(file.path(getwd(), "..")), | |
| install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | |
| )) | |
| print(coverage) | |
| covr::to_cobertura(coverage) | |
| list.files("../", pattern="*.xml", recursive=TRUE) | |
| shell: Rscript {0} | |
| working-directory: r | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| fail_ci_if_error: true | |
| files: ./r/cobertura.xml | |
| verbose: true | |
| flags: R | |
| plugins: noop | |
| disable_search: true | |
| token: ${{secrets.CODECOV_TOKEN}} | |
| pkgdown: | |
| name: pkgdown ${{ matrix.os }} (${{ matrix.r }}) | |
| needs: R-CMD-check | |
| permissions: | |
| contents: write # github-pages-deploy-action | |
| concurrency: # Recommended if you intend to make multiple deployments in quick succession. | |
| group: web-${{ github.workflow }}-${{ github.ref }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| r: [release] | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.r }} | |
| use-public-rspm: true | |
| - name: Install optipng | |
| run: sudo apt-get install -y optipng | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| install-pandoc: true | |
| extra-packages: any::pkgdown, local::. | |
| needs: website | |
| working-directory: r | |
| - name: Build website | |
| run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, run_dont_run = TRUE) | |
| shell: Rscript {0} | |
| working-directory: r | |
| - name: Deploy 🚀 | |
| if: success() && github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: r/docs # The folder the action should deploy. | |
| target-folder: r | |
| single-commit: true | |
| clean: true | |
| rchk: | |
| needs: pkgdown | |
| uses: multi-objective/moocore/.github/workflows/rchk.yml@main |